Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2025-09-04 16:13:37 -04:00
commit 55bb265514
No known key found for this signature in database
4 changed files with 22 additions and 6 deletions

View file

@ -152,9 +152,10 @@ export default definePlugin({
patches: [
{
find: '"TITLEBAR_FAST_TRAVEL"',
find: '?"BACK_FORWARD_NAVIGATION":',
replacement: {
match: /focusSectionProps:"HELP".{0,20},className:(\i)\}\),/,
// TODO: (?:\.button) is for stable compat and should be removed soon:tm:
match: /focusSectionProps:"HELP".{0,20},className:(\i(?:\.button)?)\}\),/,
replace: "$& $self.renderVencordPopoutButton($1),"
}
}

View file

@ -68,7 +68,7 @@ export default definePlugin({
},
// Change top right chat toolbar button from the help one to the dev one
{
find: '"TITLEBAR_FAST_TRAVEL"',
find: '?"BACK_FORWARD_NAVIGATION":',
replacement: {
match: /hasBugReporterAccess:(\i)/,
replace: "_hasBugReporterAccess:$1=true"

View file

@ -20,6 +20,7 @@ import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import type { Message } from "@vencord/discord-types";
import { ChannelStore, GuildMemberStore } from "@webpack/common";
const settings = definePluginSettings({
userList: {
@ -28,16 +29,22 @@ const settings = definePluginSettings({
type: OptionType.STRING,
default: "1234567890123445,1234567890123445",
},
roleList: {
description:
"List of roles to allow or exempt pings for (separated by commas or spaces)",
type: OptionType.STRING,
default: "1234567890123445,1234567890123445",
},
shouldPingListed: {
description: "Behaviour",
type: OptionType.SELECT,
options: [
{
label: "Do not ping the listed users",
label: "Do not ping the listed users / roles",
value: false,
},
{
label: "Only ping the listed users",
label: "Only ping the listed users / roles",
value: true,
default: true,
},
@ -57,7 +64,14 @@ export default definePlugin({
settings,
shouldMention(message: Message, isHoldingShift: boolean) {
const isListed = settings.store.userList.includes(message.author.id);
let isListed = settings.store.userList.includes(message.author.id);
const channel = ChannelStore.getChannel(message.channel_id);
if (channel?.guild_id && !isListed) {
const roles = GuildMemberStore.getMember(channel.guild_id, message.author.id)?.roles;
isListed = !!roles && roles.some(role => settings.store.roleList.includes(role));
}
const isExempt = settings.store.shouldPingListed ? isListed : !isListed;
return settings.store.inverseShiftReply ? isHoldingShift !== isExempt : !isHoldingShift && isExempt;
},

View file

@ -28,6 +28,7 @@ const Engines = {
Yandex: "https://yandex.com/images/search?rpt=imageview&url=",
SauceNAO: "https://saucenao.com/search.php?url=",
IQDB: "https://iqdb.org/?url=",
Bing: "https://www.bing.com/images/search?view=detailv2&iss=sbi&q=imgurl:",
TinEye: "https://www.tineye.com/search?url=",
ImgOps: "https://imgops.com/start?url="
} as const;