This commit is contained in:
Mirco Wittrien 2021-02-24 17:32:17 +01:00
parent ac0e2b39ee
commit 287e9495a9
5 changed files with 47 additions and 37 deletions

View File

@ -16,13 +16,13 @@ module.exports = (_ => {
"info": {
"name": "BDFDB",
"author": "DevilBro",
"version": "1.3.9",
"version": "1.4.0",
"description": "Give other plugins utility functions"
},
"rawUrl": "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js",
"changeLog": {
"fixed": {
"Color Picker": "Fixed Issue with Color Swatches Component"
"progress": {
"New Meta Headers": "Adjusted Update Check for new Plugin Meta Headers"
}
}
};
@ -619,7 +619,7 @@ module.exports = (_ => {
LibraryRequires.request(url, (error, response, body) => {
if (error || !PluginStores.updateData.plugins[url]) return callback(null);
let newName = (body.match(/"name"\s*:\s*"([^"]+)"/) || [])[1] || pluginName;
let newVersion = (body.match(/['"][0-9]+\.[0-9]+\.[0-9]+['"]/i) || "").toString().replace(/['"]/g, "");
let newVersion = (body.match(/@version ([0-9]+\.[0-9]+\.[0-9]+)|['"]([0-9]+\.[0-9]+\.[0-9]+)['"]/i) || []).filter(n => n)[1];
if (!newVersion) return callback(null);
if (pluginName == newName && BDFDB.NumberUtils.getVersionDifference(newVersion, PluginStores.updateData.plugins[url].version) > 0.2) {
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_force_updated", pluginName), {
@ -773,7 +773,7 @@ module.exports = (_ => {
else {
let wasEnabled = BDFDB.BDUtils.isPluginEnabled(pluginName);
let newName = (body.match(/"name"\s*:\s*"([^"]+)"/) || [])[1] || pluginName;
let newVersion = body.match(/['"][0-9]+\.[0-9]+\.[0-9]+['"]/i).toString().replace(/['"]/g, "");
let newVersion = (body.match(/@version ([0-9]+\.[0-9]+\.[0-9]+)|['"]([0-9]+\.[0-9]+\.[0-9]+)['"]/i) || []).filter(n => n)[1];
let oldVersion = PluginStores.updateData.plugins[url].version;
let fileName = pluginName == "BDFDB" ? "0BDFDB" : pluginName;
let newFileName = newName == "BDFDB" ? "0BDFDB" : newName;

View File

@ -14,12 +14,12 @@ module.exports = (_ => {
"info": {
"name": "EditChannels",
"author": "DevilBro",
"version": "4.2.5",
"description": "Allow you to rename and recolor channelnames"
"version": "4.2.6",
"description": "Allow you to rename and recolor Channel Names"
},
"changeLog": {
"improved": {
"Canary Changes": "Preparing Plugins for the changes that are already done on Discord Canary"
"fixed": {
"Mentions": ""
}
}
};
@ -108,7 +108,7 @@ module.exports = (_ => {
QuickSwitchChannelResult: "render",
SearchResultsInner: "default",
RecentsChannelHeader: "default",
ChannelMention: "ChannelMention"
RichChannelMention: "ChannelMention"
}
};
@ -508,7 +508,7 @@ module.exports = (_ => {
}
}
processChannelMention (e) {
processRichChannelMention (e) {
if (e.instance.props.id && settings.changeInMentions) {
let name = (changedChannels[e.instance.props.id] || {}).name;
let color = this.getChannelDataColor(e.instance.props.id);

View File

@ -14,12 +14,12 @@ module.exports = (_ => {
"info": {
"name": "EditUsers",
"author": "DevilBro",
"version": "4.1.5",
"version": "4.1.6",
"description": "Allow you to change the icon, name, tag and color of users"
},
"changeLog": {
"fixed": {
"Incoming Call Popup": ""
"Mentions": ""
}
}
};
@ -148,8 +148,8 @@ module.exports = (_ => {
MessageContent: "type",
Reaction: "render",
ReactorsComponent: "render",
Mention: "default",
UserMention: "UserMention",
UserMention: "default",
RichUserMention: "UserMention",
ChannelReply: "default",
MemberListItem: "render",
UserHook: "render",
@ -393,7 +393,7 @@ module.exports = (_ => {
}
processNameTag (e) {
if (e.instance.props.user && (e.instance.props.className || e.instance.props.usernameClass)) {
if (e.returnvalue && e.instance.props.user && (e.instance.props.className || e.instance.props.usernameClass)) {
let change = false, guildId = null;
let changeBackground = false;
let tagClass = "";
@ -717,13 +717,14 @@ module.exports = (_ => {
}
}
processMention (e) {
processUserMention (e) {
if (e.instance.props.userId && settings.changeInMentions && changedUsers[e.instance.props.userId] && this.shouldChangeInChat()) {
this.changeMention(e.returnvalue, changedUsers[e.instance.props.userId]);
let mention = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "Mention"});
if (mention) this.changeMention(mention, changedUsers[e.instance.props.userId]);
}
}
processUserMention (e) {
processRichUserMention (e) {
if (e.instance.props.id && settings.changeInMentions && changedUsers[e.instance.props.id] && this.shouldChangeInChat()) {
let data = changedUsers[e.instance.props.id];
let tooltipChildren = BDFDB.ObjectUtils.get(e, "returnvalue.props.text.props.children");

View File

@ -14,12 +14,12 @@ module.exports = (_ => {
"info": {
"name": "RemoveBlockedMessages",
"author": "DevilBro",
"version": "1.2.3",
"version": "1.2.4",
"description": "Removes blocked messages/users completely"
},
"changeLog": {
"fixed": {
"Update Reactions": "Fixed issue where reaction sometimes wouldn't show up at all, really now"
"Mentions": ""
}
}
};
@ -103,7 +103,8 @@ module.exports = (_ => {
Reactions: "render",
MemberListItem: "render",
VoiceUser: "render",
Mention: "default"
UserMention: "default",
RichUserMention: "UserMention"
}
};
@ -373,9 +374,16 @@ module.exports = (_ => {
if (settings.removeUsers && BDFDB.ArrayUtils.is(e.instance.props.users)) e.instance.props.users = [].concat(e.instance.props.users).filter(n => !n || !BDFDB.LibraryModules.FriendUtils.isBlocked(n.id));
}
processMention (e) {
if (settings.removeMentions && e.instance.props.userId && BDFDB.LibraryModules.FriendUtils.isBlocked(e.instance.props.userId)) return BDFDB.ReactUtils.createElement("span", {
className: BDFDB.disCNS.mention + BDFDB.disCN.mentionwrapper,
processUserMention (e) {
if (e.instance.props.userId && settings.removeMentions && BDFDB.LibraryModules.FriendUtils.isBlocked(e.instance.props.userId)) return BDFDB.ReactUtils.createElement("span", {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.mention, BDFDB.disCN.mentionwrapper, e.instance.props.className),
children: ["@" + BDFDB.LanguageUtils.LanguageStrings.UNKNOWN_USER]
});
}
processRichUserMention (e) {
if (e.instance.props.id && settings.removeMentions && BDFDB.LibraryModules.FriendUtils.isBlocked(e.instance.props.id)) return BDFDB.ReactUtils.createElement("span", {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.mention, BDFDB.disCN.mentionwrapper, e.instance.props.className),
children: ["@" + BDFDB.LanguageUtils.LanguageStrings.UNKNOWN_USER]
});
}

View File

@ -14,12 +14,12 @@ module.exports = (_ => {
"info": {
"name": "RemoveNicknames",
"author": "DevilBro",
"version": "1.3.6",
"version": "1.3.7",
"description": "Replace all nicknames with the actual accountnames"
},
"changeLog": {
"fixed": {
"Messages": "Works in messages again"
"Mentions": ""
}
}
};
@ -68,10 +68,10 @@ module.exports = (_ => {
onLoad () {
this.defaults = {
settings: {
replaceOwn: {value: false, inner: false, description: "Replace your own name: "},
replaceBots: {value: true, inner: false, description: "Replace the nickname of bots: "},
addNickname: {value: false, inner: false, description: "Add nickname as parentheses: "},
swapPositions: {value: false, inner: false, description: "Swap the position of username and nickname: "},
replaceOwn: {value: false, inner: false, description: "Replace your own Name"},
replaceBots: {value: true, inner: false, description: "Replace the Nickname of Bots"},
addNickname: {value: false, inner: false, description: "Add Nickname as Parentheses"},
swapPositions: {value: false, inner: false, description: "Swap the Position of Username and Nickname"},
changeInChatWindow: {value: true, inner: true, description: "Messages"},
changeInReactions: {value: true, inner: true, description: "Reactions"},
changeInMentions: {value: true, inner: true, description: "Mentions"},
@ -92,8 +92,8 @@ module.exports = (_ => {
after: {
TypingUsers: "render",
Reaction: "render",
Mention: "default",
UserMention: "UserMention"
UserMention: "default",
RichUserMention: "UserMention"
}
};
}
@ -197,14 +197,15 @@ module.exports = (_ => {
});
}
processMention (e) {
processUserMention (e) {
if (e.instance.props.userId && settings.changeInMentions) {
let newName = this.getNewName(BDFDB.LibraryModules.UserStore.getUser(e.instance.props.userId));
if (newName) e.returnvalue.props.children[0] = "@" + newName;
let mention = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "Mention"});
let newName = mention && this.getNewName(BDFDB.LibraryModules.UserStore.getUser(e.instance.props.userId));
if (newName) mention.props.children[0] = "@" + newName;
}
}
processUserMention (e) {
processRichUserMention (e) {
if (e.instance.props.id && settings.changeInMentions && typeof e.returnvalue.props.children == "function") {
let newName = this.getNewName(BDFDB.LibraryModules.UserStore.getUser(e.instance.props.id));
if (newName) {