Update EditUsers.plugin.js

This commit is contained in:
Mirco Wittrien 2021-06-02 17:21:12 +02:00
parent 6c49213cfb
commit fc13db9f47
1 changed files with 18 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* @name EditUsers * @name EditUsers
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 4.2.5 * @version 4.2.6
* @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,13 +17,16 @@ module.exports = (_ => {
"info": { "info": {
"name": "EditUsers", "name": "EditUsers",
"author": "DevilBro", "author": "DevilBro",
"version": "4.2.5", "version": "4.2.6",
"description": "Allows you to locally edit Users" "description": "Allows you to locally edit Users"
}, },
"changeLog": { "changeLog": {
"added": { "added": {
"Show Server Nickname": "Added an Option to Show the Server Nickname behind the local Nickname", "Show Server Nickname": "Added an Option to Show the Server Nickname behind the local Nickname",
"Banners": "Added Support for banners" "Banners": "Added Support for banners"
},
"fixed": {
"Voice User List": "Fixed Voice User List not being changed in some places"
} }
} }
}; };
@ -112,6 +115,7 @@ module.exports = (_ => {
UserInfo: "default", UserInfo: "default",
NowPlayingHeader: "Header", NowPlayingHeader: "Header",
VoiceUser: "render", VoiceUser: "render",
RTCConnectionVoiceUsers: "default",
Account: "render", Account: "render",
Message: "default", Message: "default",
MessageUsername: "default", MessageUsername: "default",
@ -556,7 +560,7 @@ module.exports = (_ => {
} }
} }
} }
processVoiceUser (e) { processVoiceUser (e) {
if (e.instance.props.user && this.settings.places.voiceChat) { if (e.instance.props.user && this.settings.places.voiceChat) {
if (!e.returnvalue) { if (!e.returnvalue) {
@ -574,6 +578,17 @@ module.exports = (_ => {
} }
} }
processRTCConnectionVoiceUsers (e) {
if (e.instance.props.voiceStates && this.settings.places.voiceChat) for (let i in e.instance.props.voiceStates) {
let data = changedUsers[e.instance.props.voiceStates[i].user.id];
if (data) {
e.instance.props.voiceStates[i] = Object.assign({}, e.instance.props.voiceStates[i]);
e.instance.props.voiceStates[i].user = this.getUserData(e.instance.props.voiceStates[i].user.id);
if (data.name && (!e.instance.props.voiceStates[i].member.nick || !data.useServerNick)) e.instance.props.voiceStates[i].nick = [data.name, data.showServerNick && e.instance.props.voiceStates[i].member.nick && `(${e.instance.props.voiceStates[i].member.nick})`].filter(n => n).join(" ");
}
}
}
processAccount (e) { processAccount (e) {
if (e.instance.props.currentUser && this.settings.places.userAccount) { if (e.instance.props.currentUser && this.settings.places.userAccount) {
let data = changedUsers[e.instance.props.currentUser.id]; let data = changedUsers[e.instance.props.currentUser.id];