diff options
author | Nuckyz <61953774+Nuckyz@users.noreply.github.com> | 2023-03-19 22:03:33 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-19 22:03:33 -0300 |
commit | e36f4e5b0aed93f6b24a42eb738fc5f38579bf3c (patch) | |
tree | ab16d02f33e949fc34f9c0bc457fc8f861b931aa /src/plugins | |
parent | 4aff11421f1cccaf34a7c983fd8dc9a841042947 (diff) | |
download | Vencord-e36f4e5b0aed93f6b24a42eb738fc5f38579bf3c.tar.gz Vencord-e36f4e5b0aed93f6b24a42eb738fc5f38579bf3c.tar.bz2 Vencord-e36f4e5b0aed93f6b24a42eb738fc5f38579bf3c.zip |
Fixes and make guild tooltip show users inside hidden voice channels (#613)
* Fix #509
* Fix #597
* Fix #594
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/messageLogger/index.tsx | 1 | ||||
-rw-r--r-- | src/plugins/noBlockedMessages.ts | 13 | ||||
-rw-r--r-- | src/plugins/showHiddenChannels/index.tsx | 8 |
3 files changed, 17 insertions, 5 deletions
diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index ef05cf3..e13da35 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -174,6 +174,7 @@ export default definePlugin({ match: /(MESSAGE_UPDATE:function\((\w)\).+?)\.update\((\w)/, replace: "$1" + ".update($3,m =>" + + " (($2.message.flags & 64) === 64 || (Vencord.Settings.plugins.MessageLogger.ignoreBots && $2.message.author?.bot) || (Vencord.Settings.plugins.MessageLogger.ignoreSelf && $2.message.author?.id === Vencord.Webpack.Common.UserStore.getCurrentUser().id)) ? m :" + " $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ?" + " m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) :" + " m" + diff --git a/src/plugins/noBlockedMessages.ts b/src/plugins/noBlockedMessages.ts index 6937041..d91572a 100644 --- a/src/plugins/noBlockedMessages.ts +++ b/src/plugins/noBlockedMessages.ts @@ -37,16 +37,19 @@ export default definePlugin({ } ] }, - { - find: "displayName=\"MessageStore\"", + ...[ + 'displayName="MessageStore"', + 'displayName="ReadStateStore"' + ].map(find => ({ + find, predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true, replacement: [ { - match: /(?<=MESSAGE_CREATE:function\((\w)\){var \w=\w\.channelId,\w=\w\.message,\w=\w\.isPushNotification,\w=\w\.\w\.getOrCreate\(\w\));/, - replace: ";if($self.isBlocked(n))return;" + match: /(?<=MESSAGE_CREATE:function\((\i)\){)/, + replace: (_, props) => `if($self.isBlocked(${props}.message))return;` } ] - } + })) ], options: { ignoreBlockedMessages: { diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index eb49468..318bad2 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -335,6 +335,14 @@ export default definePlugin({ match: /(?<=getChannel\((\i)\)\)(?=.{0,100}?selectVoiceChannel))/, replace: (_, channelId) => `&&!$self.isHiddenChannel({channelId:${channelId}})` } + }, + { + find: '.displayName="GuildChannelStore"', + replacement: { + // Make GuildChannelStore contain hidden channels for users in voice channels to appear in the guild tooltip + match: /isChannelGated\(.+?\)(?=\|\|)/, + replace: m => `${m}||true` + } } ], |