This commit is contained in:
Mirco Wittrien 2022-02-25 16:12:53 +01:00
parent 796cb90716
commit c497cd4fc1
9 changed files with 96 additions and 73 deletions

View File

@ -87,21 +87,23 @@ module.exports = (_ => {
messageString && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { messageString && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)", label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message"), id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message"),
hint: hint && (_ => { hint: hint && (_ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, { hint: hint
hint: hint })),
}); icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT
}), }),
action: _ => { action: _ => BDFDB.LibraryRequires.electron.clipboard.write({text: messageString})
BDFDB.LibraryRequires.electron.clipboard.write({text: messageString});
}
}), }),
embedString && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { embedString && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw Embed)", label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw Embed)",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-embed"), id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-embed"),
action: _ => { icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
BDFDB.LibraryRequires.electron.clipboard.write({text: embedString}); className: BDFDB.disCN.menuicon,
} name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT
}),
action: _ => BDFDB.LibraryRequires.electron.clipboard.write({text: embedString})
}) })
].filter(n => n); ].filter(n => n);
if (entries.length) { if (entries.length) {
@ -119,15 +121,11 @@ module.exports = (_ => {
children.splice(index + 1, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { children.splice(index + 1, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)", label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message-raw"), id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message-raw"),
icon: _ => { icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { className: BDFDB.disCN.menuicon,
className: BDFDB.disCN.menuicon, name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT }),
}); action: _ => BDFDB.LibraryRequires.electron.clipboard.write({text: e.instance.props.message.content})
},
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text: e.instance.props.message.content});
}
})); }));
} }
} }

View File

@ -292,7 +292,7 @@ module.exports = (_ => {
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "quote"}); let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "quote"});
if (index > -1) { if (index > -1) {
item = children[index]; item = children[index];
item.props.action = event => {action(null, event.shiftKey);}; item.props.action = event => action(null, event.shiftKey);
} }
else { else {
item = BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { item = BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
@ -312,12 +312,14 @@ module.exports = (_ => {
})) }))
}); });
else { else {
item.props.icon = _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.QUOTE
});
let hint = BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Quote_Message") : null; let hint = BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Quote_Message") : null;
if (hint) item.props.hint = _ => { if (hint) item.props.hint = _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, { hint: hint
hint: hint });
});
};
} }
} }
} }
@ -330,12 +332,10 @@ module.exports = (_ => {
children.splice(index > -1 ? index : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { children.splice(index > -1 ? index : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.QUOTE, label: BDFDB.LanguageUtils.LanguageStrings.QUOTE,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "quote"), id: BDFDB.ContextMenuUtils.createItemId(this.name, "quote"),
icon: _ => { icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { className: BDFDB.disCN.menuicon,
className: BDFDB.disCN.menuicon, name: BDFDB.LibraryComponents.SvgIcon.Names.QUOTE
name: BDFDB.LibraryComponents.SvgIcon.Names.QUOTE }),
});
},
action: event => { action: event => {
this.quote(e.instance.props.channel, e.instance.props.message, event.shiftKey); this.quote(e.instance.props.channel, e.instance.props.message, event.shiftKey);
} }

View File

@ -2,7 +2,7 @@
* @name EditChannels * @name EditChannels
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 4.3.5 * @version 4.3.6
* @description Allows you to locally edit Channels * @description Allows you to locally edit Channels
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": { "info": {
"name": "EditChannels", "name": "EditChannels",
"author": "DevilBro", "author": "DevilBro",
"version": "4.3.5", "version": "4.3.6",
"description": "Allows you to locally edit Channels" "description": "Allows you to locally edit Channels"
}, },
"changeLog": { "changeLog": {
"improved": { "fixed": {
"Threads": "Works flawlessly with Threads now" "PlatformIndicators": "Fixed Plugin Issue with PlatformIndicators that broke Features in the DM List"
} }
} }
}; };
@ -512,15 +512,16 @@ module.exports = (_ => {
processPrivateChannel (e) { processPrivateChannel (e) {
if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.channelList) { if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.channelList) {
if (typeof e.returnvalue.props.children == "function") { let wrapper = e.returnvalue && e.returnvalue.props.children && e.returnvalue.props.children.props && typeof e.returnvalue.props.children.props.children == "function" ? e.returnvalue.props.children : e.returnvalue;
let childrenRender = e.returnvalue.props.children; if (typeof wrapper.props.children == "function") {
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => { let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args); let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children); this._processPrivateChannel(e.instance, children);
return children; return children;
}, "Error in Children Render of PrivateChannel!", this); }, "Error in Children Render of PrivateChannel!", this);
} }
else this._processPrivateChannel(e.instance, e.returnvalue); else this._processPrivateChannel(e.instance, wrapper);
} }
} }

View File

@ -2,7 +2,7 @@
* @name EditUsers * @name EditUsers
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 4.5.1 * @version 4.5.2
* @description Allows you to locally edit Users * @description Allows you to locally edit Users
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,8 +17,13 @@ module.exports = (_ => {
"info": { "info": {
"name": "EditUsers", "name": "EditUsers",
"author": "DevilBro", "author": "DevilBro",
"version": "4.5.1", "version": "4.5.2",
"description": "Allows you to locally edit Users" "description": "Allows you to locally edit Users"
},
"changeLog": {
"fixed": {
"PlatformIndicators": "Fixed Plugin Issue with PlatformIndicators that broke Features in the DM List"
}
} }
}; };
@ -1093,15 +1098,16 @@ module.exports = (_ => {
} }
} }
else { else {
if (typeof e.returnvalue.props.children == "function") { let wrapper = e.returnvalue && e.returnvalue.props.children && e.returnvalue.props.children.props && typeof e.returnvalue.props.children.props.children == "function" ? e.returnvalue.props.children : e.returnvalue;
let childrenRender = e.returnvalue.props.children; if (typeof wrapper.props.children == "function") {
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => { let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args); let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children); this._processPrivateChannel(e.instance, children);
return children; return children;
}, "Error in Children Render of PrivateChannel!", this); }, "Error in Children Render of PrivateChannel!", this);
} }
else this._processPrivateChannel(e.instance, e.returnvalue); else this._processPrivateChannel(e.instance, wrapper);
} }
} }
} }

View File

@ -408,11 +408,17 @@ module.exports = (_ => {
hint: hint && (_ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, { hint: hint && (_ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
hint: hint hint: hint
})), })),
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
icon: note ? pinIconDelete : pinIcon
}),
action: _ => this.addMessageToNotes(e.instance.props.message, e.instance.props.channel) action: _ => this.addMessageToNotes(e.instance.props.message, e.instance.props.channel)
})); }));
if (this.isNoteOutdated(note, e.instance.props.message)) children.splice(index > -1 ? index + 1: 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { if (this.isNoteOutdated(note, e.instance.props.message)) children.splice(index > -1 ? index + 1: 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_updateoption, label: this.labels.context_updateoption,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "update-note"), id: BDFDB.ContextMenuUtils.createItemId(this.name, "update-note"),
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
icon: pinIconUpdate
}),
action: _ => this.updateNoteData(note, e.instance.props.message) action: _ => this.updateNoteData(note, e.instance.props.message)
})); }));
} }

View File

@ -2,7 +2,7 @@
* @name PinDMs * @name PinDMs
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.8.8 * @version 1.8.9
* @description Allows you to pin DMs, making them appear at the top of your DMs/ServerList * @description Allows you to pin DMs, making them appear at the top of your DMs/ServerList
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,8 +17,13 @@ module.exports = (_ => {
"info": { "info": {
"name": "PinDMs", "name": "PinDMs",
"author": "DevilBro", "author": "DevilBro",
"version": "1.8.8", "version": "1.8.9",
"description": "Allows you to pin DMs, making them appear at the top of your DMs/ServerList" "description": "Allows you to pin DMs, making them appear at the top of your DMs/ServerList"
},
"changeLog": {
"fixed": {
"PlatformIndicators": "Fixed Plugin Issue with PlatformIndicators that broke Features in the DM List"
}
} }
}; };
@ -676,15 +681,16 @@ module.exports = (_ => {
} }
} }
if (e.returnvalue) { if (e.returnvalue) {
if (typeof e.returnvalue.props.children == "function") { let wrapper = e.returnvalue && e.returnvalue.props.children && e.returnvalue.props.children.props && typeof e.returnvalue.props.children.props.children == "function" ? e.returnvalue.props.children : e.returnvalue;
let childrenRender = e.returnvalue.props.children; if (typeof wrapper.props.children == "function") {
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => { let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args); let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children, category); this._processPrivateChannel(e.instance, children, category);
return children; return children;
}, "Error in Children Render of PrivateChannel!", this); }, "Error in Children Render of PrivateChannel!", this);
} }
else this._processPrivateChannel(e.instance, e.returnvalue, category); else this._processPrivateChannel(e.instance, wrapper, category);
} }
} }
} }

View File

@ -2,7 +2,7 @@
* @name RemoveBlockedUsers * @name RemoveBlockedUsers
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.3.7 * @version 1.3.8
* @description Removes blocked Messages/Users * @description Removes blocked Messages/Users
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": { "info": {
"name": "RemoveBlockedUsers", "name": "RemoveBlockedUsers",
"author": "DevilBro", "author": "DevilBro",
"version": "1.3.7", "version": "1.3.8",
"description": "Removes blocked Messages/Users" "description": "Removes blocked Messages/Users"
}, },
"changeLog": { "changeLog": {
"fixed": { "fixed": {
"Server Notifications": "No longer kills all server notification icons" "PlatformIndicators": "Fixed Plugin Issue with PlatformIndicators that broke Features in the DM List"
} }
} }
}; };
@ -416,15 +416,16 @@ module.exports = (_ => {
} }
else { else {
if (!e.instance.props.channel.name) { if (!e.instance.props.channel.name) {
if (typeof e.returnvalue.props.children == "function") { let wrapper = e.returnvalue && e.returnvalue.props.children && e.returnvalue.props.children.props && typeof e.returnvalue.props.children.props.children == "function" ? e.returnvalue.props.children : e.returnvalue;
let childrenRender = e.returnvalue.props.children; if (typeof wrapper.props.children == "function") {
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => { let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args); let children = childrenRender(...args);
children.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(e.instance.props.channel.id)}); children.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(e.instance.props.channel.id)});
return children; return children;
}, "", this); }, "", this);
} }
else e.returnvalue.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(e.instance.props.channel.id)}); else wrapper.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(e.instance.props.channel.id)});
} }
} }
} }

View File

@ -2,7 +2,7 @@
* @name ShowBadgesInChat * @name ShowBadgesInChat
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.8.5 * @version 1.8.6
* @description Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList * @description Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,8 +17,13 @@ module.exports = (_ => {
"info": { "info": {
"name": "ShowBadgesInChat", "name": "ShowBadgesInChat",
"author": "DevilBro", "author": "DevilBro",
"version": "1.8.5", "version": "1.8.6",
"description": "Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList" "description": "Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList"
},
"changeLog": {
"fixed": {
"PlatformIndicators": "Fixed Plugin Issue with PlatformIndicators that broke Features in the DM List"
}
} }
}; };
@ -281,15 +286,16 @@ module.exports = (_ => {
processPrivateChannel (e) { processPrivateChannel (e) {
if (!e.instance.props.user || !this.settings.places.dmsList) return; if (!e.instance.props.user || !this.settings.places.dmsList) return;
if (typeof e.returnvalue.props.children == "function") { let wrapper = e.returnvalue && e.returnvalue.props.children && e.returnvalue.props.children.props && typeof e.returnvalue.props.children.props.children == "function" ? e.returnvalue.props.children : e.returnvalue;
let childrenRender = e.returnvalue.props.children; if (typeof wrapper.props.children == "function") {
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => { let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args); let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children); this._processPrivateChannel(e.instance, children);
return children; return children;
}, "Error in Children Render of PrivateChannel!", this); }, "Error in Children Render of PrivateChannel!", this);
} }
else this._processPrivateChannel(e.instance, e.returnvalue); else this._processPrivateChannel(e.instance, wrapper);
} }
_processPrivateChannel (instance, returnvalue, a) { _processPrivateChannel (instance, returnvalue, a) {

View File

@ -525,10 +525,11 @@ module.exports = (_ => {
children.splice(index > -1 ? index + 1 : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { children.splice(index > -1 ? index + 1 : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: translated ? this.labels.context_messageuntranslateoption : this.labels.context_messagetranslateoption, label: translated ? this.labels.context_messageuntranslateoption : this.labels.context_messagetranslateoption,
id: BDFDB.ContextMenuUtils.createItemId(this.name, translated ? "untranslate-message" : "translate-message"), id: BDFDB.ContextMenuUtils.createItemId(this.name, translated ? "untranslate-message" : "translate-message"),
hint: hint && (_ => { hint: hint && (_ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, { hint: hint
hint: hint })),
}); icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
icon: translated ? translateIconUntranslate : translateIcon
}), }),
disabled: !translated && isTranslating, disabled: !translated && isTranslating,
action: _ => this.translateMessage(e.instance.props.message, e.instance.props.channel) action: _ => this.translateMessage(e.instance.props.message, e.instance.props.channel)
@ -602,11 +603,9 @@ module.exports = (_ => {
label: translated ? this.labels.context_messageuntranslateoption : this.labels.context_messagetranslateoption, label: translated ? this.labels.context_messageuntranslateoption : this.labels.context_messagetranslateoption,
disabled: isTranslating, disabled: isTranslating,
id: BDFDB.ContextMenuUtils.createItemId(this.name, translated ? "untranslate-message" : "translate-message"), id: BDFDB.ContextMenuUtils.createItemId(this.name, translated ? "untranslate-message" : "translate-message"),
icon: _ => { icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, { icon: translated ? translateIconUntranslate : translateIcon
icon: translated ? translateIconUntranslate : translateIcon }),
});
},
action: _ => this.translateMessage(e.instance.props.message, e.instance.props.channel) action: _ => this.translateMessage(e.instance.props.message, e.instance.props.channel)
})); }));
} }