Skip to content

Commit

Permalink
Merge remote-tracking branch 'forky/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceiridge committed Apr 9, 2022
2 parents f7ed6bb + cb057d8 commit 9a37650
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SimpleDiscordCrypt.meta.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ==UserScript==
// @name SimpleDiscordCrypt Extended
// @version 1.7.1.1
// @version 1.7.1.2
// ==/UserScript==
12 changes: 7 additions & 5 deletions SimpleDiscordCrypt.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name SimpleDiscordCrypt Extended
// @namespace https://github.com/Ceiridge/SimpleDiscordCrypt-Extended
// @version 1.7.1.1
// @version 1.7.1.2
// @description I hope people won't start calling this SDC ^_^
// @author An0, leogx9r, Ceiridge
// @license LGPLv3 - https://www.gnu.org/licenses/lgpl-3.0.txt
Expand Down Expand Up @@ -2284,7 +2284,9 @@ function Init(final)
message.edited_timestamp = null; //in case the message is still loading when updated
}
else Discord.dispatch({type: 'MESSAGE_UPDATE', message});
}
},

Can: (permission, user, context) => Discord.can({ permission, user, context })
});
//Discord.window.SdcUtils = Utils;
//Discord.window.SdcDiscord = Discord;
Expand Down Expand Up @@ -3081,14 +3083,14 @@ function postProcessMessage(message, content) {
let canMentionEveryone;
if(everyoneRegex.test(content)) {
if(channel == null) channel = Discord.getChannel(message.channel_id);
message.mention_everyone = canMentionEveryone = Discord.can(MENTION_EVERYONE_CHECK, message.author, channel);
message.mention_everyone = canMentionEveryone = Utils.Can(MENTION_EVERYONE_CHECK, message.author, channel);
}

let mentionRoles = [...content.matchAll(roleMentionRegex)].map(x => x[1]);
if(mentionRoles.length !== 0) {
if(canMentionEveryone == null) {
if(channel == null) channel = Discord.getChannel(message.channel_id);
canMentionEveryone = Discord.can(MENTION_EVERYONE_CHECK, message.author, channel);
canMentionEveryone = Utils.Can(MENTION_EVERYONE_CHECK, message.author, channel);
}
if(!canMentionEveryone) {
let guild = Discord.getGuild(guildId);
Expand Down Expand Up @@ -3585,7 +3587,7 @@ async function handleSend(channelId, message, forceSimple) {
let payload = Utils.PayloadEncode(messageBytes);

let channel = Discord.getChannel(channelId);
if(forceSimple || Cache.channelBlacklist === 2 || (channel.type === 0 && !Discord.can(EMBED_LINKS_CHECK, Discord.getCurrentUser(), channel))) {
if(forceSimple || Cache.channelBlacklist === 2 || (channel.type === 0 && !Utils.Can(EMBED_LINKS_CHECK, Discord.getCurrentUser(), channel))) {
message.content = payload + " `𝘚𝘪𝘮𝘱𝘭𝘦𝘋𝘪𝘴𝘤𝘰𝘳𝘥𝘊𝘳𝘺𝘱𝘵`";
}
else {
Expand Down

0 comments on commit 9a37650

Please sign in to comment.