Skip to content

Fix In App Notifications#397

Open
thehamish555 wants to merge 3 commits intoQWERTxD:mainfrom
thehamish555:patch-3
Open

Fix In App Notifications#397
thehamish555 wants to merge 3 commits intoQWERTxD:mainfrom
thehamish555:patch-3

Conversation

@thehamish555
Copy link

Taken from Reddit

Might have a better solution, but this appears to work

@iyu46
Copy link

iyu46 commented Jun 27, 2024

might as well just delete the mentions to isMentioned if you can't find it again in the webpack

the code as it is in this PR is incomplete because there's no checking if the role(s) mentioned in the message are roles that you have, so you get notifications for random shit in random servers

i can't push a commit to this branch, but i would roll back the version marker to 1.1.5, and change lines 996-1009 to this

            const currentUserId = UserStore.getCurrentUser().id;
            const mentionedUsers = message.mentions.map(user => user.id);
            const messageRoles =  message.mention_roles;
            let roleMentioned = false;
            if (message.mention_roles) {
              const currentUserRoles = GuildMemberStore.getSelfMember(message.guild_id).roles;
              roleMentioned = (currentUserRoles.some(i => messageRoles.includes(i)));
            }
            return mentionedUsers.includes(currentUserId) ||
                  (!suppressEveryone && message.mention_everyone) ||
                  (!suppressRoles && message.mention_roles.length > 0 && roleMentioned);

@thehamish555
Copy link
Author

I assume that's the changes you wanted? Let me know if there is anything else!

@iyu46
Copy link

iyu46 commented Jun 27, 2024

spacing is a lil funky, and qwert can probably update the changelog properly on their own, but yeah that does look mostly right! missing removing the import on isMentioned though but doesn't really matter

@thehamish555
Copy link
Author

Yeah sorry about that, worked a bit from my phone. Do you want me to change the changelogs back? or just leave the PR as it is?

@Czerwony150
Copy link

I don't know about others but in my case this plugin doesn't turn on when starting DSC. When trying to turn it off, it shows information that it can't be stopped and only re-enabling it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants