OnePingPerDM: fix server pings

This commit is contained in:
Vendicated 2023-11-01 02:09:43 +01:00
parent 584885acf5
commit 9af2ec65ae
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -55,10 +55,8 @@ export default definePlugin({
}], }],
isPrivateChannelRead(message: MessageJSON) { isPrivateChannelRead(message: MessageJSON) {
const channelType = ChannelStore.getChannel(message.channel_id)?.type; const channelType = ChannelStore.getChannel(message.channel_id)?.type;
if (channelType !== ChannelType.DM && channelType !== ChannelType.GROUP_DM) {
return false;
}
if ( if (
(channelType !== ChannelType.DM && channelType !== ChannelType.GROUP_DM) ||
(channelType === ChannelType.DM && settings.store.channelToAffect === "group_dm") || (channelType === ChannelType.DM && settings.store.channelToAffect === "group_dm") ||
(channelType === ChannelType.GROUP_DM && settings.store.channelToAffect === "user_dm") || (channelType === ChannelType.GROUP_DM && settings.store.channelToAffect === "user_dm") ||
(settings.store.allowMentions && message.mentions.some(m => m.id === UserStore.getCurrentUser().id)) || (settings.store.allowMentions && message.mentions.some(m => m.id === UserStore.getCurrentUser().id)) ||