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, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message"),
hint: hint && (_ => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
hint: hint
});
hint: hint && (_ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
hint: hint
})),
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT
}),
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text: messageString});
}
action: _ => BDFDB.LibraryRequires.electron.clipboard.write({text: messageString})
}),
embedString && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw Embed)",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-embed"),
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text: embedString});
}
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT
}),
action: _ => BDFDB.LibraryRequires.electron.clipboard.write({text: embedString})
})
].filter(n => n);
if (entries.length) {
@ -119,15 +121,11 @@ module.exports = (_ => {
children.splice(index + 1, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message-raw"),
icon: _ => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT
});
},
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text: e.instance.props.message.content});
}
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT
}),
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"});
if (index > -1) {
item = children[index];
item.props.action = event => {action(null, event.shiftKey);};
item.props.action = event => action(null, event.shiftKey);
}
else {
item = BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
@ -312,12 +312,14 @@ module.exports = (_ => {
}))
});
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;
if (hint) item.props.hint = _ => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
hint: hint
});
};
if (hint) item.props.hint = _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
hint: hint
});
}
}
}
@ -330,12 +332,10 @@ module.exports = (_ => {
children.splice(index > -1 ? index : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.QUOTE,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "quote"),
icon: _ => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.QUOTE
});
},
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.menuicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.QUOTE
}),
action: event => {
this.quote(e.instance.props.channel, e.instance.props.message, event.shiftKey);
}

View File

@ -2,7 +2,7 @@
* @name EditChannels
* @author DevilBro
* @authorId 278543574059057154
* @version 4.3.5
* @version 4.3.6
* @description Allows you to locally edit Channels
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": {
"name": "EditChannels",
"author": "DevilBro",
"version": "4.3.5",
"version": "4.3.6",
"description": "Allows you to locally edit Channels"
},
"changeLog": {
"improved": {
"Threads": "Works flawlessly with Threads now"
"fixed": {
"PlatformIndicators": "Fixed Plugin Issue with PlatformIndicators that broke Features in the DM List"
}
}
};
@ -512,15 +512,16 @@ module.exports = (_ => {
processPrivateChannel (e) {
if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.channelList) {
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
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;
if (typeof wrapper.props.children == "function") {
let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children);
return children;
}, "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
* @author DevilBro
* @authorId 278543574059057154
* @version 4.5.1
* @version 4.5.2
* @description Allows you to locally edit Users
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,8 +17,13 @@ module.exports = (_ => {
"info": {
"name": "EditUsers",
"author": "DevilBro",
"version": "4.5.1",
"version": "4.5.2",
"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 {
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
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;
if (typeof wrapper.props.children == "function") {
let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children);
return children;
}, "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
})),
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
icon: note ? pinIconDelete : pinIcon
}),
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, {
label: this.labels.context_updateoption,
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)
}));
}

View File

@ -2,7 +2,7 @@
* @name PinDMs
* @author DevilBro
* @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
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,8 +17,13 @@ module.exports = (_ => {
"info": {
"name": "PinDMs",
"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"
},
"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 (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
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;
if (typeof wrapper.props.children == "function") {
let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children, category);
return children;
}, "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
* @author DevilBro
* @authorId 278543574059057154
* @version 1.3.7
* @version 1.3.8
* @description Removes blocked Messages/Users
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": {
"name": "RemoveBlockedUsers",
"author": "DevilBro",
"version": "1.3.7",
"version": "1.3.8",
"description": "Removes blocked Messages/Users"
},
"changeLog": {
"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 {
if (!e.instance.props.channel.name) {
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
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;
if (typeof wrapper.props.children == "function") {
let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
children.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(e.instance.props.channel.id)});
return children;
}, "", 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
* @author DevilBro
* @authorId 278543574059057154
* @version 1.8.5
* @version 1.8.6
* @description Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,8 +17,13 @@ module.exports = (_ => {
"info": {
"name": "ShowBadgesInChat",
"author": "DevilBro",
"version": "1.8.5",
"version": "1.8.6",
"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) {
if (!e.instance.props.user || !this.settings.places.dmsList) return;
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
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;
if (typeof wrapper.props.children == "function") {
let childrenRender = wrapper.props.children;
wrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children);
return children;
}, "Error in Children Render of PrivateChannel!", this);
}
else this._processPrivateChannel(e.instance, e.returnvalue);
else this._processPrivateChannel(e.instance, wrapper);
}
_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, {
label: translated ? this.labels.context_messageuntranslateoption : this.labels.context_messagetranslateoption,
id: BDFDB.ContextMenuUtils.createItemId(this.name, translated ? "untranslate-message" : "translate-message"),
hint: hint && (_ => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
hint: hint
});
hint: hint && (_ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
hint: hint
})),
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
icon: translated ? translateIconUntranslate : translateIcon
}),
disabled: !translated && isTranslating,
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,
disabled: isTranslating,
id: BDFDB.ContextMenuUtils.createItemId(this.name, translated ? "untranslate-message" : "translate-message"),
icon: _ => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
icon: translated ? translateIconUntranslate : translateIcon
});
},
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
icon: translated ? translateIconUntranslate : translateIcon
}),
action: _ => this.translateMessage(e.instance.props.message, e.instance.props.channel)
}));
}