BetterDiscordAddons/Plugins/EditUsers/EditUsers.plugin.js

2572 lines
134 KiB
JavaScript
Raw Normal View History

2020-10-20 23:25:34 +02:00
/**
* @name EditUsers
2021-03-05 13:26:41 +01:00
* @author DevilBro
2020-10-20 23:25:34 +02:00
* @authorId 278543574059057154
2023-11-04 12:42:42 +01:00
* @version 4.8.5
2021-03-05 13:26:41 +01:00
* @description Allows you to locally edit Users
2020-10-20 23:25:34 +02:00
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
* @patreon https://www.patreon.com/MircoWittrien
2021-03-09 15:10:55 +01:00
* @website https://mwittrien.github.io/
* @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/EditUsers/
2021-03-10 09:17:37 +01:00
* @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/EditUsers/EditUsers.plugin.js
2020-10-20 23:25:34 +02:00
*/
2018-10-11 10:21:26 +02:00
2020-09-19 20:49:33 +02:00
module.exports = (_ => {
2022-09-01 14:40:11 +02:00
const changeLog = {
2023-03-18 12:22:28 +01:00
2020-09-19 20:49:33 +02:00
};
2020-11-13 19:47:44 +01:00
2022-02-05 21:14:17 +01:00
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
2022-09-01 14:55:22 +02:00
constructor (meta) {for (let key in meta) this[key] = meta[key];}
getName () {return this.name;}
getAuthor () {return this.author;}
getVersion () {return this.version;}
getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;}
2021-02-01 17:13:13 +01:00
downloadLibrary () {
2023-11-18 18:31:04 +01:00
BdApi.Net.fetch("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js").then(r => {
if (!r || r.status != 200) throw new Error();
else return r.text();
}).then(b => {
if (!b) throw new Error();
else return require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"}));
}).catch(error => {
BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library");
2021-02-01 17:13:13 +01:00
});
}
2020-09-19 20:49:33 +02:00
2021-01-06 12:38:36 +01:00
load () {
2020-11-19 16:51:14 +01:00
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
2020-09-19 20:49:33 +02:00
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
2022-09-01 14:55:22 +02:00
BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, {
2020-09-19 20:49:33 +02:00
confirmText: "Download Now",
cancelText: "Cancel",
onCancel: _ => {delete window.BDFDB_Global.downloadModal;},
2020-09-20 08:15:13 +02:00
onConfirm: _ => {
delete window.BDFDB_Global.downloadModal;
2021-02-01 17:13:13 +01:00
this.downloadLibrary();
2020-09-20 08:15:13 +02:00
}
2020-09-19 20:49:33 +02:00
});
}
2022-09-01 14:55:22 +02:00
if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name);
2020-10-09 21:09:35 +02:00
}
2021-01-06 12:38:36 +01:00
start () {this.load();}
stop () {}
getSettingsPanel () {
2020-11-28 23:12:09 +01:00
let template = document.createElement("template");
2022-09-01 14:55:22 +02:00
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The Library Plugin needed for ${this.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
2021-02-01 17:13:13 +01:00
template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary);
2020-11-28 23:12:09 +01:00
return template.content.firstElementChild;
}
2020-10-09 21:09:35 +02:00
} : (([Plugin, BDFDB]) => {
2021-05-20 16:44:45 +02:00
var changedUsers = {};
2022-11-23 10:55:10 +01:00
var appTitleObserver;
2020-09-19 20:49:33 +02:00
2020-10-09 21:09:35 +02:00
return class EditUsers extends Plugin {
2021-01-06 12:38:36 +01:00
onLoad () {
2020-09-19 20:49:33 +02:00
this.defaults = {
2021-05-20 16:44:45 +02:00
types: {
servers: {value: true, description: "Servers"},
dms: {value: true, description: "Direct Messages"},
},
places: {
2023-11-18 18:31:04 +01:00
contextMenu: {value: true, description: "User ContextMenu"},
chatTextarea: {value: true, description: "Chat Textarea"},
2021-05-20 16:44:45 +02:00
chatWindow: {value: true, description: "Messages"},
reactions: {value: true, description: "Reactions"},
mentions: {value: true, description: "Mentions"},
memberList: {value: true, description: "Member List"},
voiceChat: {value: true, description: "Voice Channels"},
recentDms: {value: true, description: "Direct Message Notifications"},
dmsList: {value: true, description: "Direct Message List"},
dmHeader: {value: true, description: "Direct Message Header"},
dmCalls: {value: true, description: "Calls/ScreenShares"},
typing: {value: true, description: "Typing List"},
friendList: {value: true, description: "Friend List"},
inviteList: {value: true, description: "Invite List"},
activity: {value: true, description: "Activity Page"},
userPopout: {value: true, description: "User Popouts"},
2023-11-18 18:31:04 +01:00
userProfile: {value: true, description: "User Profile Modal"},
autocompletes: {value: true, description: "Autocomplete Menu"},
guildSettings: {value: true, description: "Server Settings"},
quickSwitcher: {value: true, description: "Quick Switcher"},
searchPopout: {value: true, description: "Search Popout"},
userAccount: {value: true, description: "Your Account Information"},
2021-05-20 16:44:45 +02:00
appTitle: {value: true, description: "Discord App Title (DMs)"}
2020-09-19 20:49:33 +02:00
}
};
2020-02-07 15:16:40 +01:00
2022-11-29 19:38:55 +01:00
this.modulePatches = {
before: [
"Account",
"AuditLogEntry",
"AutocompleteUserResult",
"ChannelCall",
"ChannelCallGrid",
"ChannelCallVideoParticipants",
"ChannelReply",
"ChannelTextAreaEditor",
"DirectMessageAddPopout",
"GuildBans",
"GuildEmojis",
"GuildInvitationRow",
"GuildInvites",
"GuildMemberEntry",
"MemberListItem",
"Message",
"MessageContent",
"MessageHeader",
2023-11-04 12:42:42 +01:00
"MessageUsername",
2023-11-02 19:55:00 +01:00
"NameContainer",
2022-11-29 19:38:55 +01:00
"NowPlayingItem",
"PictureInPictureVideo",
"PrivateChannel",
"QuickSwitcher",
"QuickSwitchUserResult",
"RTCConnectionVoiceUsers",
"SearchPopoutOption",
"ThreadMessageAccessoryMessage",
"UserBanner",
"UserBannerMask",
"UserInfo",
2023-03-11 13:28:44 +01:00
"UsernameSection",
2022-11-29 19:38:55 +01:00
"UserPopoutAvatar",
"UserProfile",
"UserProfileHeader",
"UserProfileUsername",
"UserSummaryItem",
"VoiceUser"
],
after: [
"Account",
"AuditLogs",
"AutocompleteUserResult",
"ChannelCallHeader",
"ChannelReply",
"ChannelEmptyMessages",
"DirectMessage",
"DirectMessageAddPopoutRow",
"DiscordTag",
"GuildInvitationRow",
2023-06-06 22:43:34 +02:00
"HeaderBarRecipient",
2022-11-29 19:38:55 +01:00
"IncomingCallModal",
2023-03-10 13:30:33 +01:00
"Mention",
2022-11-29 19:38:55 +01:00
"MessageContent",
2023-11-04 12:42:42 +01:00
"MessageReply",
2022-11-29 19:38:55 +01:00
"NameTag",
"ParticipantsForSelectedParticipant",
"PrivateChannel",
"QuickSwitchUserResult",
"RTCConnection",
2023-11-02 19:55:00 +01:00
"ReactionsModalUser",
2022-11-29 19:38:55 +01:00
"RichUserMention",
"SearchPopoutOption",
"ThreadCardDescription",
"ThreadEmptyMessageAuthor",
"TypingUsers",
"UserMention",
"UsernameSection",
"UserProfileMutualFriends",
2023-11-02 19:55:00 +01:00
"UserProfileUsername",
2022-11-29 19:38:55 +01:00
"VoiceUser"
]
2020-09-19 20:49:33 +02:00
};
2020-12-07 19:42:24 +01:00
this.patchPriority = 3;
2020-09-19 20:49:33 +02:00
this.css = `
2021-06-30 15:11:47 +02:00
${BDFDB.dotCN.messageavatar} {
background-size: cover;
object-fit: cover;
}
2023-11-02 19:55:00 +01:00
${BDFDB.dotCNS.userprofilemodal + BDFDB.dotCNS.linedefaultcolor + BDFDB.dotCN.bottag} {
display: inline-flex;
margin-top: 4px;
}
2020-09-19 20:49:33 +02:00
${BDFDB.dotCNS.dmchannel + BDFDB.dotCN.bottag} {
margin-left: 4px;
}
2021-07-03 15:16:45 +02:00
${BDFDB.dotCNS.peoplesuser + BDFDB.dotCN.peoplesdiscriminator} {
2020-09-19 20:49:33 +02:00
display: none;
}
2021-07-03 15:16:45 +02:00
${BDFDB.dotCNS.peoplesuserhovered + BDFDB.dotCN.peoplesdiscriminator} {
2020-09-19 20:49:33 +02:00
display: block;
}
2023-11-04 12:42:42 +01:00
${BDFDB.dotCN.message} span[style*="--edited-user-color-gradient"] ${BDFDB.dotCN.messageusername} {
background-image: var(--edited-user-color-gradient) !important;
color: transparent !important;
text-decoration-color: var(--edited-user-color) !important;
-webkit-background-clip: text;
}
2020-10-20 22:48:48 +02:00
${BDFDB.dotCN.messagemarkup} span[style*="linear-gradient"] code.inline,
${BDFDB.dotCN.messagemarkup} span[style*="linear-gradient"] blockquote,
${BDFDB.dotCN.messagemarkup} span[style*="linear-gradient"] ${BDFDB.dotCN.spoilertext} {
color: var(--text-normal);
}
2023-03-10 13:30:33 +01:00
${BDFDB.dotCN.mention}[style*="--edited-mention-color"] {
background-color: rgba(var(--edited-mention-color), .1) !important;
color: rgb(var(--edited-mention-color)) !important;
}
${BDFDB.dotCN.mention + BDFDB.dotCN.mentioninteractive}[style*="--edited-mention-color"]:hover {
background-color: rgba(var(--edited-mention-color), .3) !important;
color: rgb(var(--edited-mention-color)) !important;
}
2020-09-19 20:49:33 +02:00
`;
2020-02-07 15:16:40 +01:00
}
2020-09-19 20:49:33 +02:00
2022-11-23 10:55:10 +01:00
onStart () {
appTitleObserver = new MutationObserver(_ => this.changeAppTitle());
appTitleObserver.observe(document.head.querySelector("title"), {childList: true});
2022-05-26 15:01:24 +02:00
2022-11-29 22:30:49 +01:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.UserNameUtils, "getName", {after: e => {
2022-08-03 00:12:47 +02:00
if (e.methodArguments[2] && changedUsers[e.methodArguments[2].id] && changedUsers[e.methodArguments[2].id].name) return changedUsers[e.methodArguments[2].id].name;
}});
2022-09-27 16:53:10 +02:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryStores.StageChannelParticipantStore, "getMutableParticipants", {after: e => {
2022-05-26 15:01:24 +02:00
if (BDFDB.ArrayUtils.is(e.returnValue)) for (let i in e.returnValue) {
if (e.returnValue[i] && e.returnValue[i].user && changedUsers[e.returnValue[i].user.id]) e.returnValue[i] = Object.assign({}, e.returnValue[i], {user: this.getUserData(e.returnValue[i].user.id)});
}
}});
2020-02-07 15:16:40 +01:00
2022-11-29 19:38:55 +01:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, ["getAuthor", "getMessageAuthor"], {after: e => {
if (!this.settings.places.chatWindow || !e.methodArguments[0] || !e.methodArguments[0].author || !changedUsers[e.methodArguments[0].author.id] || !this.shouldChangeInChat(e.methodArguments[0].channel_id)) return;
let data = changedUsers[e.methodArguments[0].author.id];
if (!data) return;
let member = BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(e.methodArguments[0].channel_id) || {}).guild_id, e.methodArguments[0].author.id);
let color1 = data.color1 && data.useRoleColor && member && member.colorString || data.color1;
color1 = color1 && BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
e.returnValue = Object.assign({}, e.returnValue, {
2023-06-20 09:23:42 +02:00
nick: this.getUserNick(e.methodArguments[0].author.id, member && member.nick || e.methodArguments[0].author.globalName) || e.returnValue.nick,
2022-11-29 19:38:55 +01:00
guildMemberAvatar: (data.removeIcon || data.url) ? null : e.returnValue.guildMemberAvatar,
colorString: color1 || e.returnValue.colorString
});
2021-01-07 14:25:35 +01:00
}});
2022-08-29 15:04:18 +02:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.QuerySearchUtils, ["queryDMUsers", "queryFriends"], {after: e => {
if (!e.methodArguments[0].query) return;
2022-09-27 20:05:55 +02:00
for (let id in changedUsers) if (changedUsers[id] && changedUsers[id].name && changedUsers[id].name.toLocaleLowerCase().indexOf(e.methodArguments[0].query.toLocaleLowerCase()) > -1 && !e.returnValue.find(n => n.record && n.record.id == id && n.type == BDFDB.DiscordConstants.AutocompleterResultTypes.USER)) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(id);
2022-08-29 15:04:18 +02:00
if (user) e.returnValue.push({
2023-06-20 09:23:42 +02:00
comparator: (user.globalName || user.username),
2022-08-29 15:04:18 +02:00
record: user,
score: 10,
2023-06-20 09:23:42 +02:00
sortable: (user.globalName || user.username).toLocaleLowerCase(),
2022-09-27 20:05:55 +02:00
type: BDFDB.DiscordConstants.AutocompleterResultTypes.USER
2022-08-29 15:04:18 +02:00
});
}
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.QuerySearchUtils, "queryGuildUsers", {after: e => {
if (!e.methodArguments[0].query) return;
2022-09-27 20:05:55 +02:00
for (let id in changedUsers) if (changedUsers[id] && changedUsers[id].name && changedUsers[id].name.toLocaleLowerCase().indexOf(e.methodArguments[0].query.toLocaleLowerCase()) > -1 && !e.returnValue.find(n => n.record && n.record.id == id && n.type == BDFDB.DiscordConstants.AutocompleterResultTypes.USER)) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(id);
let member = user && e.methodArguments[0].guildId && BDFDB.LibraryStores.GuildMemberStore.getMember(e.methodArguments[0].guildId, id);
2022-08-29 15:04:18 +02:00
if (user) e.returnValue.push({
2023-06-20 09:23:42 +02:00
comparator: member && member.nick ? member.nick.toLocaleLowerCase() : (user.globalName || user.username).toLocaleLowerCase(),
2022-08-29 15:04:18 +02:00
record: user,
2021-06-25 20:59:24 +02:00
score: 0,
2022-09-27 20:05:55 +02:00
type: BDFDB.DiscordConstants.AutocompleterResultTypes.USER
2022-08-29 15:04:18 +02:00
});
}
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.QuerySearchUtils, "queryChannelUsers", {after: e => {
if (!e.methodArguments[0].query) return;
2022-09-27 20:05:55 +02:00
for (let id in changedUsers) if (changedUsers[id] && changedUsers[id].name && changedUsers[id].name.toLocaleLowerCase().indexOf(e.methodArguments[0].query.toLocaleLowerCase()) > -1 && !e.returnValue.find(n => n.record && n.record.id == id && n.type == BDFDB.DiscordConstants.AutocompleterResultTypes.USER)) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(id);
let member = user && e.methodArguments[0].channelId && BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(e.methodArguments[0].channelId) || {}).guild_id, id);
2022-08-29 15:04:18 +02:00
if (user) e.returnValue.push({
2023-06-20 09:23:42 +02:00
comparator: member && member.nick ? member.nick.toLocaleLowerCase() : (user.globalName || user.username).toLocaleLowerCase(),
2022-08-29 15:04:18 +02:00
record: user,
score: 0,
2022-09-27 20:05:55 +02:00
type: BDFDB.DiscordConstants.AutocompleterResultTypes.USER
2022-08-29 15:04:18 +02:00
});
2020-09-26 18:37:56 +02:00
}
}});
2020-02-07 15:16:40 +01:00
2021-06-01 17:25:52 +02:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.IconUtils, "getUserBannerURL", {instead: e => {
2022-08-14 12:44:51 +02:00
let data = changedUsers[e.methodArguments[0].id];
if (data) {
if (data.removeBanner) return null;
else if (data.banner) return data.banner;
2021-06-01 17:25:52 +02:00
}
return e.callOriginalMethod();
}});
2023-03-16 16:03:04 +01:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MemberDisplayUtils, "getUserProfile", {after: e => {
2023-03-11 13:28:44 +01:00
if (!e.returnValue || !changedUsers[e.methodArguments[0]] || !changedUsers[e.methodArguments[0]].color5 && !changedUsers[e.methodArguments[0]].color6 && !changedUsers[e.methodArguments[0]].color7) return;
2023-04-20 11:38:12 +02:00
let newProfileObject = BDFDB.ObjectUtils.copy(e.returnValue);
2023-03-11 13:28:44 +01:00
if (changedUsers[e.methodArguments[0]].color5) newProfileObject.primaryColor = newProfileObject.accentColor = BDFDB.ColorUtils.convert(changedUsers[e.methodArguments[0]].color5, "INT");
if (changedUsers[e.methodArguments[0]].color6 || changedUsers[e.methodArguments[0]].color7) {
let isLightTheme = BDFDB.DiscordUtils.getTheme() == BDFDB.disCN.themelight;
newProfileObject.themeColors = [
BDFDB.ColorUtils.convert(changedUsers[e.methodArguments[0]].color6 || (isLightTheme ? "#FFF" : "#000"), "INT"),
BDFDB.ColorUtils.convert(changedUsers[e.methodArguments[0]].color7 || (isLightTheme ? "#FFF" : "#000"), "INT")
];
newProfileObject.canEditThemes = true;
}
return newProfileObject;
}});
2022-09-27 16:53:10 +02:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryStores.PresenceStore, "findActivity", {after: e => {
2021-06-25 16:06:39 +02:00
let data = changedUsers[e.methodArguments[0]];
if (data && (data.removeStatus || data.status || data.statusEmoji) && (e.returnValue && e.returnValue.type === BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS || !e.returnValue && e.methodArguments[1] && e.methodArguments[1].toString().indexOf("type===") > -1 && e.methodArguments[1].toString().indexOf("CUSTOM_STATUS") > -1)) return this.createCustomStatus(changedUsers[e.methodArguments[0]]);
2021-06-12 16:04:20 +02:00
}});
2020-02-07 15:16:40 +01:00
this.forceUpdateAll();
2018-10-11 10:21:26 +02:00
}
2020-09-19 20:49:33 +02:00
2021-01-06 12:38:36 +01:00
onStop () {
2022-11-23 10:55:10 +01:00
if (appTitleObserver) appTitleObserver.disconnect();
2020-02-07 15:16:40 +01:00
this.forceUpdateAll();
}
2019-06-16 19:30:24 +02:00
2020-09-19 20:49:33 +02:00
getSettingsPanel (collapseStates = {}) {
2021-04-23 12:01:44 +02:00
let settingsPanel;
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, {
collapseStates: collapseStates,
children: _ => {
let settingsItems = [];
2021-05-20 16:44:45 +02:00
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelList, {
title: "Change Users in:",
children: Object.keys(this.defaults.places).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "Switch",
plugin: this,
keys: ["places", key],
label: this.defaults.places[key].description,
value: this.settings.places[key]
}))
}));
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelList, {
title: "Change Users in the Chat Window (Messages, Reactions, Mentions, etc.) in:",
children: Object.keys(this.defaults.types).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
2021-04-23 12:01:44 +02:00
type: "Switch",
plugin: this,
2021-05-20 16:44:45 +02:00
keys: ["types", key],
label: this.defaults.types[key].description,
value: this.settings.types[key]
2021-04-23 12:01:44 +02:00
}))
}));
2021-05-20 16:44:45 +02:00
2021-04-28 09:07:55 +02:00
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsLabel, {
label: "Changed Users:"
}));
2021-04-23 12:01:44 +02:00
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Button",
color: BDFDB.LibraryComponents.Button.Colors.RED,
2021-04-28 09:07:55 +02:00
label: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
2023-06-20 09:23:42 +02:00
children: !Object.keys(changedUsers).length ? BDFDB.LanguageUtils.LanguageStrings.NONE : Object.keys(changedUsers).filter(BDFDB.LibraryStores.UserStore.getUser).map(id => {
let userData = this.getUserData(id);
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: userData.globalName || userData.username,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatars.Avatar, {
className: BDFDB.disCN.listavatar,
src: this.getUserAvatar(id),
size: BDFDB.LibraryComponents.AvatarConstants.Sizes.SIZE_32,
onClick: _ => this.openUserSettingsModal(BDFDB.LibraryStores.UserStore.getUser(id))
})
});
})
2021-04-28 09:07:55 +02:00
}),
2021-04-23 12:01:44 +02:00
onClick: _ => {
BDFDB.ModalUtils.confirm(this, this.labels.confirm_resetall, _ => {
BDFDB.DataUtils.remove(this, "users");
2021-04-28 09:07:55 +02:00
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
2021-04-23 12:01:44 +02:00
this.forceUpdateAll();
});
},
children: BDFDB.LanguageUtils.LanguageStrings.RESET
}));
return settingsItems;
}
});
2020-09-19 20:49:33 +02:00
}
2019-01-26 22:45:19 +01:00
2021-01-06 12:38:36 +01:00
onSettingsClosed () {
2020-09-19 20:49:33 +02:00
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
2020-07-12 17:40:01 +02:00
}
2020-02-07 15:16:40 +01:00
2021-01-06 12:38:36 +01:00
forceUpdateAll () {
2020-09-19 20:49:33 +02:00
changedUsers = BDFDB.DataUtils.load(this, "users");
2022-02-24 23:26:44 +01:00
2020-09-19 20:49:33 +02:00
this.changeAppTitle();
BDFDB.PatchUtils.forceAllUpdates(this);
2022-05-26 15:01:24 +02:00
BDFDB.DiscordUtils.rerenderAll();
2018-12-22 22:34:45 +01:00
}
2020-02-07 15:16:40 +01:00
2020-09-19 20:49:33 +02:00
onUserContextMenu (e) {
2022-02-28 21:05:45 +01:00
if (e.instance.props.channel && e.instance.props.channel.isDM()) {
2022-09-27 16:53:10 +02:00
const user = BDFDB.LibraryStores.UserStore.getUser(e.instance.props.channel.getRecipientId());
2022-11-29 19:38:55 +01:00
if (user && this.settings.places.contextMenu) {
2023-06-20 09:23:42 +02:00
let userData = this.getUserData(user.id);
if (userData.globalName && userData.globalName != user.globalName || !userData.globalName && userData.username != user.username) {
2022-02-28 21:05:45 +01:00
let [muteChildren, muteIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "mute-channel"});
2023-06-20 09:23:42 +02:00
if (muteIndex > -1) muteChildren[muteIndex].props.label = BDFDB.LanguageUtils.LanguageStringsFormat("MUTE_CHANNEL", `@${userData.globalName || userData.username}`);
2022-02-28 21:05:45 +01:00
let [unmuteChildren, unmuteIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "unmute-channel"});
2023-06-20 09:23:42 +02:00
if (unmuteIndex > -1) unmuteChildren[unmuteIndex].props.label = BDFDB.LanguageUtils.LanguageStringsFormat("UNMUTE_CHANNEL", `@${userData.globalName || userData.username}`);
2022-02-28 21:05:45 +01:00
}
}
}
2020-09-19 20:49:33 +02:00
if (e.instance.props.user) {
2022-11-29 19:38:55 +01:00
if (this.settings.places.contextMenu) {
2023-06-23 18:12:09 +02:00
let userData = this.getUserData(e.instance.props.user.id);
2023-06-20 09:23:42 +02:00
if (userData.globalName && userData.globalName != e.instance.props.user.globalName || !userData.globalName && userData.username != e.instance.props.user.username) {
let username = userData.globalName || userData.username;
2022-02-24 23:26:44 +01:00
let [timeoutChildren, timeoutIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "timeout"});
2023-06-20 09:23:42 +02:00
if (timeoutIndex > -1) timeoutChildren[timeoutIndex].props.label = BDFDB.LanguageUtils.LanguageStringsFormat("DISABLE_GUILD_COMMUNICATION_FOR_USER", username);
2022-02-24 23:26:44 +01:00
let [removeTimeoutChildren, removeTimeoutIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "removetimeout"});
2023-06-20 09:23:42 +02:00
if (removeTimeoutIndex > -1) removeTimeoutChildren[removeTimeoutIndex].props.label = BDFDB.LanguageUtils.LanguageStringsFormat("ENABLE_GUILD_COMMUNICATION_FOR_USER", username);
2022-02-24 23:26:44 +01:00
let [kickChildren, kickIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "kick"});
2023-06-20 09:23:42 +02:00
if (kickIndex > -1) kickChildren[kickIndex].props.label = BDFDB.LanguageUtils.LanguageStringsFormat("KICK_USER", username);
2022-02-24 23:26:44 +01:00
let [banChildren, banIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "ban"});
2023-06-20 09:23:42 +02:00
if (banIndex > -1) banChildren[banIndex].props.label = BDFDB.LanguageUtils.LanguageStringsFormat("BAN_USER", username);
2022-02-24 23:26:44 +01:00
}
2020-09-19 20:49:33 +02:00
}
2022-11-29 19:38:55 +01:00
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "devmode-copy-id", group: true});
children.splice(index > -1 ? index : children.length, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_localusersettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-submenu"),
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: [
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_usersettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-change"),
action: _ => this.openUserSettingsModal(e.instance.props.user)
}),
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_resetsettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-reset"),
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
disabled: !changedUsers[e.instance.props.user.id],
action: event => {
let remove = _ => {
BDFDB.DataUtils.remove(this, "users", e.instance.props.user.id);
this.forceUpdateAll(true);
};
if (event.shiftKey) remove();
else BDFDB.ModalUtils.confirm(this, this.labels.confirm_reset, remove);
}
})
]
2022-02-21 20:16:44 +01:00
})
2022-11-29 19:38:55 +01:00
})
}));
}
2022-02-21 20:16:44 +01:00
}
2022-10-24 10:42:20 +02:00
processChannelTextAreaEditor (e) {
2022-10-01 14:25:51 +02:00
if (!e.instance.props.disabled && e.instance.props.channel && e.instance.props.channel.isDM() && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY) && this.settings.places.chatTextarea) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(e.instance.props.channel.recipients[0]);
2023-06-20 09:23:42 +02:00
if (user) e.instance.props.placeholder = BDFDB.LanguageUtils.LanguageStringsFormat("TEXTAREA_PLACEHOLDER", `@${changedUsers[user.id] && changedUsers[user.id].name || user.globalName || user.username}`);
2020-02-07 15:16:40 +01:00
}
2019-02-07 22:54:50 +01:00
}
2020-09-19 20:49:33 +02:00
processAutocompleteUserResult (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.autocompletes || !e.instance.props.user) return;
if (!e.returnvalue) {
e.instance.props.user = this.getUserData(e.instance.props.user.id);
let data = changedUsers[e.instance.props.user.id];
if (data && data.name) e.instance.props.nick = data.name;
}
else {
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(children, {name: "AutocompleteRowContentPrimary"});
if (username) this.changeUserColor(username.props.children, e.instance.props.user.id);
2022-11-29 19:38:55 +01:00
return children;
}, "Error in Children Render of AutocompleteUserResult!", this);
2020-09-19 20:49:33 +02:00
}
2020-06-28 09:41:02 +02:00
}
}
2023-06-06 22:43:34 +02:00
processHeaderBarRecipient (e) {
if (!this.settings.places.dmHeader || !e.instance.props.channel || !e.instance.props.channel.isDM()) return;
let recipientId = e.instance.props.channel.getRecipientId();
let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelheaderavatar]]});
if (avatar) avatar.props.src = this.getUserAvatar(recipientId);
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelheadercursorpointer]]});
if (username) {
let userData = this.getUserData(recipientId);
username.props.children = userData.globalName || userData.username;
this.changeUserColor(username, recipientId);
2023-06-06 22:43:34 +02:00
}
2019-03-28 13:56:12 +01:00
}
2020-09-19 20:49:33 +02:00
processChannelCallHeader (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.dmHeader || !e.instance.props.channel || !e.instance.props.channel.isDM()) return;
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "HeaderBarTitle"});
if (!username) return;
2022-11-29 19:38:55 +01:00
let recipientId = e.instance.props.channel.getRecipientId();
if (!changedUsers[recipientId]) return;
2023-06-20 09:23:42 +02:00
let userData = this.getUserData(recipientId);
username.props.children = userData.globalName || userData.username;
this.changeUserColor(username, recipientId);
2020-09-19 20:49:33 +02:00
}
processDiscordTag (e) {
this.processNameTag(e);
}
processNameTag (e) {
2022-11-29 19:38:55 +01:00
if (!e.returnvalue || !e.instance.props.user || !changedUsers[e.instance.props.user.id] || !e.instance.props.className && !e.instance.props.usernameClass) return;
let change = false, guildId = null;
let tagClass = "";
if (e.instance.props.className) {
2023-11-02 19:55:00 +01:00
if (e.instance.props.className.indexOf(BDFDB.disCN.userpopoutheadertagwithnickname) > -1) {
2022-11-29 19:38:55 +01:00
change = this.settings.places.userPopout;
guildId = BDFDB.LibraryStores.SelectedGuildStore.getGuildId();
tagClass = BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag;
}
else if (e.instance.props.className.indexOf(BDFDB.disCN.guildsettingsinviteusername) > -1) {
change = this.settings.places.guildSettings;
}
else if (e.instance.props.className.indexOf(BDFDB.disCN.peoplesdiscordtag) > -1) {
change = this.settings.places.friendList;
tagClass = BDFDB.disCN.bottagnametag;
2020-09-19 20:49:33 +02:00
}
2022-11-29 19:38:55 +01:00
}
if (!change) return;
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.username]]});
if (username) this.changeUserColor(username, e.instance.props.user.id);
2022-11-29 19:38:55 +01:00
if (tagClass) this.injectBadge(e.returnvalue.props.children, e.instance.props.user.id, guildId, 2, {
tagClass: tagClass,
useRem: e.instance.props.useRemSizes,
inverted: e.instance.props.invertBotTagColor
});
2018-12-22 22:34:45 +01:00
}
2019-01-26 22:45:19 +01:00
2022-11-29 19:38:55 +01:00
processUserBanner (e) {
if (!e.instance.props.user || !changedUsers[e.instance.props.user.id]) return;
if (changedUsers[e.instance.props.user.id].removeBanner) {
e.instance.props.bannerSrc = null;
2023-02-07 12:31:00 +01:00
if (e.instance.props.displayProfile) e.instance.props.displayProfile.banner = null;
2022-11-29 19:38:55 +01:00
}
else if (changedUsers[e.instance.props.user.id].banner) {
e.instance.props.bannerSrc = changedUsers[e.instance.props.user.id].banner;
2023-04-28 13:04:00 +02:00
if (e.instance.props.displayProfile) {
e.instance.props.displayProfile = BDFDB.ObjectUtils.copy(e.instance.props.displayProfile);
e.instance.props.displayProfile.banner = changedUsers[e.instance.props.user.id].banner;
e.instance.props.displayProfile.premiumType = 2;
}
2021-07-29 00:36:40 +02:00
}
}
2022-11-29 19:38:55 +01:00
processUserBannerMask (e) {
if (!e.instance.props.user || !changedUsers[e.instance.props.user.id]) return;
if (changedUsers[e.instance.props.user.id].removeBanner) e.instance.props.isPremium = false;
else if (changedUsers[e.instance.props.user.id].banner) e.instance.props.isPremium = true;
2022-09-24 17:31:12 +02:00
}
2023-03-11 13:28:44 +01:00
2022-11-29 19:38:55 +01:00
processUserPopoutAvatar (e) {
if (!e.instance.props.user || !changedUsers[e.instance.props.user.id]) return;
if (this.settings.places.userPopout) e.instance.props.user = this.getUserData(e.instance.props.user.id, true, true);
if (e.instance.props.displayProfile) {
2022-09-24 17:31:12 +02:00
if (changedUsers[e.instance.props.user.id].removeBanner) {
2022-11-29 19:38:55 +01:00
e.instance.props.hasBanner = false;
2022-09-24 17:31:12 +02:00
e.instance.props.displayProfile.banner = null;
}
else if (changedUsers[e.instance.props.user.id].banner) {
2022-11-29 19:38:55 +01:00
e.instance.props.hasBanner = true;
2023-04-28 13:04:00 +02:00
e.instance.props.displayProfile = BDFDB.ObjectUtils.copy(e.instance.props.displayProfile);
2022-09-24 17:31:12 +02:00
e.instance.props.displayProfile.banner = changedUsers[e.instance.props.user.id].banner;
2023-04-28 13:04:00 +02:00
e.instance.props.displayProfile.premiumType = 2;
2022-09-24 17:31:12 +02:00
}
2022-09-03 16:19:40 +02:00
}
}
2021-11-09 17:02:30 +01:00
2022-08-31 13:02:40 +02:00
processUsernameSection (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.userPopout || !e.instance.props.user) return;
let data = changedUsers[e.instance.props.user.id];
if (!data) return;
if (!e.returnvalue) {
2023-06-20 09:23:42 +02:00
let nickname = this.getUserNick(e.instance.props.user.id, e.instance.props.nickname || e.instance.props.user.globalName);
2022-11-29 19:38:55 +01:00
e.instance.props.nickname = nickname ? nickname : null;
}
else {
if (data.color1 || data.tag) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]});
if (index > -1) {
this.changeUserColor(children[index], e.instance.props.user.id);
if (!BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children = [children[index].props.children].flat(10);
this.injectBadge(children[index].props.children, e.instance.props.user.id, BDFDB.LibraryStores.SelectedGuildStore.getGuildId(), 2, {
tagClass: BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag,
inverted: typeof e.instance.getMode == "function" && e.instance.getMode() !== "Normal"
});
2020-02-08 18:50:11 +01:00
}
2020-02-07 15:16:40 +01:00
}
2019-10-02 09:53:39 +02:00
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2022-11-03 14:30:06 +01:00
processUserProfile (e) {
2021-06-12 16:04:20 +02:00
if (e.instance.props.user && this.settings.places.userProfile) e.instance.props.user = this.getUserData(e.instance.props.user.id);
}
2022-11-03 14:30:06 +01:00
processUserProfileHeader (e) {
2021-06-25 20:17:49 +02:00
if (e.instance.props.user && this.settings.places.userProfile) e.instance.props.user = this.getUserData(e.instance.props.user.id);
}
2022-11-29 19:38:55 +01:00
processUserProfileUsername (e) {
2023-11-02 19:55:00 +01:00
if (!e.instance.props.user || !this.settings.places.userProfile) return;
if (!e.returnvalue) e.instance.props.user = this.getUserData(e.instance.props.user.id);
else {
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: ["children", "style", "variant"]});
if (!username) return;
username.props.children = BDFDB.ReactUtils.createElement(BDFDB.ReactUtils.Fragment, {children: username.props.children});
this.changeUserColor(username.props.children, e.instance.props.user.id);
username.props.children = [username.props.children];
this.injectBadge(username.props.children, e.instance.props.user.id, BDFDB.LibraryStores.SelectedGuildStore.getGuildId(), 2, {
tagClass: BDFDB.disCN.bottagnametag
});
}
2022-11-29 19:38:55 +01:00
}
processUserProfileMutualFriends (e) {
if (!this.settings.places.userProfile || !e.returnvalue.props.children || !e.returnvalue.props.children.length) return;
for (let row of e.returnvalue.props.children) if (row && row.props && row.props.user) row.props.user = this.getUserData(row.props.user.id);
2021-06-09 21:43:27 +02:00
}
2020-09-19 20:49:33 +02:00
processUserInfo (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.friendList || !e.instance.props.user) return;
e.instance.props.user = this.getUserData(e.instance.props.user.id);
if (BDFDB.ReactUtils.isValidElement(e.instance.props.subText)) {
let data = changedUsers[e.instance.props.user.id];
if (data && (data.removeStatus || data.status || data.statusEmoji)) {
e.instance.props.subText.props.activities = [].concat(e.instance.props.subText.props.activities).filter(n => n && n.type != BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS);
let activity = this.createCustomStatus(data);
if (activity) e.instance.props.subText.props.activities.unshift(activity);
2020-02-17 13:16:17 +01:00
}
}
}
2019-01-26 22:45:19 +01:00
2021-06-11 23:07:17 +02:00
processNowPlayingItem (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.activity) return;
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {name: "NowPlayingHeader"});
if (index > -1) for (let child of children) if (child && child.props && child.props.party) {
child.props.party = Object.assign({}, child.props.party);
if (child.props.party.partiedMembers) for (let i in child.props.party.partiedMembers) if (child.props.party.partiedMembers[i]) child.props.party.partiedMembers[i] = this.getUserData(child.props.party.partiedMembers[i].id);
if (child.props.party.priorityMembers) for (let i in child.props.party.priorityMembers) if (child.props.party.priorityMembers[i]) child.props.party.priorityMembers[i] = Object.assign({}, child.props.party.priorityMembers[i], {user: this.getUserData(child.props.party.priorityMembers[i].user.id)});
if (child.props.party.voiceChannels) for (let i in child.props.party.voiceChannels) if (child.props.party.voiceChannels[i]) child.props.party.voiceChannels[i] = Object.assign({}, child.props.party.voiceChannels[i], {members: [].concat(child.props.party.voiceChannels[i].members).map(user => this.getUserData(user.id))});
if (child == children[index]) {
const type = child.type;
child.type = BDFDB.TimeUtils.suppress((...args) => {
const returnValue = type(...args);
2023-06-20 09:23:42 +02:00
let user = BDFDB.ObjectUtils.get(returnValue, "props.priorityUser.user");
if (user && (user.globalName == returnValue.props.title || user.username == returnValue.props.title)) {
2022-11-29 19:38:55 +01:00
returnValue.props.title = BDFDB.ReactUtils.createElement("span", {children: returnValue.props.title});
2023-06-20 09:23:42 +02:00
this.changeUserColor(returnValue.props.title, user.id);
2022-11-29 19:38:55 +01:00
}
return returnValue;
}, "Error in Type Render of NowPlayingHeader!", this);
2020-09-19 20:49:33 +02:00
}
2020-02-08 10:24:25 +01:00
}
}
2021-06-02 17:21:12 +02:00
2020-09-19 20:49:33 +02:00
processVoiceUser (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.voiceChat || !e.instance.props.user) return;
if (!e.returnvalue) {
e.instance.props.user = this.getUserData(e.instance.props.user.id);
let data = changedUsers[e.instance.props.user.id];
if (data && data.name) {
let member = BDFDB.LibraryStores.GuildMemberStore.getMember(BDFDB.LibraryStores.SelectedGuildStore.getGuildId(), e.instance.props.user.id);
2023-06-20 09:23:42 +02:00
e.instance.props.nick = this.getUserNick(e.instance.props.user.id, e.instance.props.nick || e.instance.props.user.globalName) || e.instance.props.nick;
2020-09-19 20:49:33 +02:00
}
2020-02-07 15:16:40 +01:00
}
2022-11-29 19:38:55 +01:00
else {
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.voicename]]});
if (username) this.changeUserColor(username, e.instance.props.user.id, {modify: e.instance.props});
2022-11-29 19:38:55 +01:00
}
}
processRTCConnection (e) {
if (!this.settings.places.voiceChat || !e.instance.props.channel || !e.instance.props.channel.isDM() || typeof e.returnvalue.props.children != "function") return;
let recipientId = e.instance.props.channel.getRecipientId();
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let renderedChildren = renderChildren(...args);
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(renderedChildren, {props: [["className", BDFDB.disCN.voicedetailschannel]]});
if (username) {
let userData = this.getUserData(recipientId);
username.props.children = "@" + (userData.globalName || userData.username);
this.changeUserColor(username, recipientId);
2022-11-29 19:38:55 +01:00
}
return renderedChildren;
}, "Error in Children Render of RTCConnection!", this);
2020-02-07 15:16:40 +01:00
}
2019-09-04 12:34:02 +02:00
2021-06-02 17:21:12 +02:00
processRTCConnectionVoiceUsers (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.voiceChat || !e.instance.props.voiceStates) return;
for (let i in e.instance.props.voiceStates) {
2021-06-02 17:21:12 +02:00
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);
2023-06-20 09:23:42 +02:00
e.instance.props.voiceStates[i].nick = this.getUserNick(e.instance.props.voiceStates[i].user.id, e.instance.props.voiceStates[i].member && e.instance.props.voiceStates[i].member.nick || e.instance.props.voiceStates[i].user.globalName) || e.instance.props.voiceStates[i].nick;
2021-06-02 17:21:12 +02:00
}
}
}
2022-04-08 11:20:49 +02:00
2020-09-19 20:49:33 +02:00
processAccount (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.userAccount || !e.instance.props.currentUser || !changedUsers[e.instance.props.currentUser.id]) return;
if (!e.returnvalue) {
e.instance.props.currentUser = this.getUserData(e.instance.props.currentUser.id);
2020-09-19 20:49:33 +02:00
let data = changedUsers[e.instance.props.currentUser.id];
2022-11-29 19:38:55 +01:00
if (data && (data.removeStatus || data.status || data.statusEmoji)) e.instance.props.customStatusActivity = this.createCustomStatus(data);
}
else {
let accountButton = BDFDB.ReactUtils.findChild(e.returnvalue, {props: ["contentTypes"]});
if (accountButton) {
const renderChildren = accountButton.props.children;
accountButton.props.children = BDFDB.TimeUtils.suppress((...args) => {
const returnValue = renderChildren(...args);
const renderChildren2 = returnValue.props.children.props.children;
returnValue.props.children.props.children = BDFDB.TimeUtils.suppress((...args2) => {
const returnValue2 = renderChildren2(...args2);
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(returnValue2, {props: [["className", BDFDB.disCN.accountinfodetails]]});
if (username) this.changeUserColor(username.props.children, e.instance.props.currentUser.id);
2022-11-29 19:38:55 +01:00
return returnValue2;
}, "Error in Children Render of Account Button Children!", this);
return returnValue;
}, "Error in Children Render of Account Button!", this);
2020-09-19 20:49:33 +02:00
}
2022-04-08 11:20:49 +02:00
}
}
processPanelTitle (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.userAccount || !changedUsers[BDFDB.UserUtils.me.id] || !changedUsers[BDFDB.UserUtils.me.id].color1) return;
let user = this.getUserData(BDFDB.UserUtils.me.id);
2023-06-20 09:23:42 +02:00
if (user && (e.instance.props.children == user.globalName || e.instance.props.children == user.username)) this.changeUserColor(e.returnvalue, BDFDB.UserUtils.me.id);
}
2019-01-26 22:45:19 +01:00
2022-11-29 19:38:55 +01:00
processChannelEmptyMessages (e) {
if (!this.settings.places.chatWindow || !e.instance.props.channel || !e.instance.props.channel.isDM()) return;
let recipientId = e.instance.props.channel.getRecipientId();
if (!recipientId || !changedUsers[recipientId]) return;
const type = e.returnvalue.type;
e.returnvalue.type = BDFDB.TimeUtils.suppress((...args) => {
const returnValue = type(...args);
2023-06-20 09:23:42 +02:00
let userData = this.getUserData(recipientId);
2022-11-29 19:38:55 +01:00
if (returnValue.props.children[0]) returnValue.props.children[0].props.src = this.getUserAvatar(recipientId);
if (returnValue.props.children[1]) {
2023-06-20 09:23:42 +02:00
returnValue.props.children[1].props.children = BDFDB.ReactUtils.createElement("span", {children: userData.globalName || userData.username});
2022-11-29 19:38:55 +01:00
this.changeUserColor(returnValue.props.children[1].props.children, recipientId);
2020-09-19 20:49:33 +02:00
}
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(returnValue.props.children[2], {type: "strong"});
if (username) {
username.props.children = "@" + (userData.globalName || userData.username);
this.changeUserColor(username, recipientId);
2020-09-19 20:49:33 +02:00
}
2022-11-29 19:38:55 +01:00
return returnValue;
}, "Error in Type Render of ChannelEmptyMessages!", this);
}
processThreadEmptyMessageAuthor (e) {
if (!this.settings.places.chatWindow || !e.instance.props.userId || !changedUsers[e.instance.props.userId]) return;
const data = changedUsers[e.instance.props.userId];
const renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
const returnValue = renderChildren(...args);
2023-06-20 09:23:42 +02:00
let userData = this.getUserData(e.instance.props.userId);
2022-11-29 19:38:55 +01:00
returnValue.props.children.props.name = BDFDB.ReactUtils.createElement("span", {
2023-06-20 09:23:42 +02:00
children: userData.globalName || userData.username
2022-11-29 19:38:55 +01:00
});
this.changeUserColor(returnValue.props.children.props.name, e.instance.props.userId);
returnValue.props.children.props.color = data.color1 && (data.useRoleColor && returnValue.props.children.props.color || BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(data.color1) ? data.color1[0] : data.color1, "HEX")) || returnValue.props.children.props.color;
return returnValue;
}, "Error in Children Render of ThreadEmptyMessageAuthor!", this);
2018-12-22 22:34:45 +01:00
}
2020-09-19 20:49:33 +02:00
processMessage (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.chatWindow) return;
let header = e.instance.props.childrenHeader;
if (header && header.props && header.props.message && this.shouldChangeInChat(header.props.message.channel_id)) {
let data = changedUsers[header.props.message.author.id];
if (data) {
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(header.props.message.channel_id) || {}).guild_id, header.props.message.author.id) || {}).colorString || data.color1;
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, header.props.message, {author: this.getUserData(header.props.message.author.id, true, false, header.props.message.author)}));
if (color1) message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
header.props.message = message;
2020-02-29 20:02:20 +01:00
}
2022-11-29 19:38:55 +01:00
}
let content = e.instance.props.childrenMessageContent;
if (content && content.type && content.type.type && content.props.message && this.shouldChangeInChat(content.props.message.channel_id)) {
let data = changedUsers[content.props.message.author.id];
if (data) {
let messageColor = data.color2 || (BDFDB.ObjectUtils.get(BDFDB.BDUtils.getPlugin("BetterRoleColors", true), "settings.modules.chat") && (data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(content.props.message.channel_id) || {}).guild_id, content.props.message.author.id) || {}).colorString || data.color1));
if (messageColor) {
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, content.props.message, {author: this.getUserData(content.props.message.author.id, true, false, content.props.message.author)}));
message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(messageColor) ? messageColor[0] : messageColor, "HEX");
content.props.message = message;
2020-09-19 20:49:33 +02:00
}
2020-02-29 20:02:20 +01:00
}
2022-11-29 19:38:55 +01:00
}
let repliedMessage = e.instance.props.childrenRepliedMessage;
if (repliedMessage && repliedMessage.props && repliedMessage.props.children && repliedMessage.props.children.props && repliedMessage.props.children.props.referencedMessage && repliedMessage.props.children.props.referencedMessage.message && this.shouldChangeInChat(repliedMessage.props.children.props.referencedMessage.message.channel_id)) {
let referenceMessage = repliedMessage.props.children.props.referencedMessage.message;
let data = changedUsers[referenceMessage.author.id];
if (data) {
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(referenceMessage.channel_id) || {}).guild_id, header.props.message.author.id) || {}).colorString || data.color1;
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, referenceMessage, {author: this.getUserData(referenceMessage.author.id, true, false, referenceMessage.author)}));
if (color1) message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
repliedMessage.props.children.props.referencedMessage = Object.assign({}, repliedMessage.props.children.props.referencedMessage, {message: message});
2020-10-27 16:25:26 +01:00
}
2020-02-10 08:59:57 +01:00
}
}
2020-09-19 20:49:33 +02:00
2022-11-29 19:38:55 +01:00
processMessageHeader (e) {
if (!this.settings.places.chatWindow || !e.instance.props.message || !this.shouldChangeInChat(e.instance.props.message.channel_id)) return;
2021-06-11 23:07:17 +02:00
const author = e.instance.props.userOverride || e.instance.props.message.author;
let data = changedUsers[author.id];
if (!data) return;
2022-11-29 19:38:55 +01:00
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, author.id) || {}).colorString || data.color1;
if (e.instance.props.userOverride) e.instance.props.userOverride = this.getUserData(author.id)
else {
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, e.instance.props.message, {author: this.getUserData(author.id, true, false, author)}));
2023-11-04 12:42:42 +01:00
if (color1) message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
2022-11-29 19:38:55 +01:00
e.instance.props.message = message;
2020-02-07 15:16:40 +01:00
}
2023-11-04 12:42:42 +01:00
let fontGradient = BDFDB.ObjectUtils.is(color1);
if (!fontGradient) return;
let [children, index] = BDFDB.ReactUtils.findParent(e.instance.props.username, {filter: n => n && n.props && n.props.decorations});
if (index == -1) return;
children[index] = BDFDB.ReactUtils.createElement("span", {
style: {
"--edited-user-color": fontGradient ? BDFDB.ColorUtils.convert(color1[0], "RGBA") : BDFDB.ColorUtils.convert(color1, "RGBA"),
[fontGradient ? "--edited-user-color-gradient" : ""]: fontGradient ? BDFDB.ColorUtils.createGradient(color1) : ""
},
children: children[index]
});
2022-11-29 19:38:55 +01:00
}
2023-11-04 12:42:42 +01:00
processMessageReply (e) {
if (!this.settings.places.chatWindow || !e.instance.props.referencedMessage.message || !this.shouldChangeInChat(e.instance.props.referencedMessage.message.channel_id)) return;
const author = e.instance.props.referencedMessage.message.author;
2022-11-29 19:38:55 +01:00
let data = changedUsers[author.id];
if (!data) return;
2023-11-04 12:42:42 +01:00
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.referencedMessage.message.channel_id) || {}).guild_id, author.id) || {}).colorString || data.color1;
if (e.instance.props.userOverride) e.instance.props.userOverride = this.getUserData(author.id)
else {
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, e.instance.props.referencedMessage.message, {author: this.getUserData(author.id, true, false, author)}));
if (color1) message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
e.instance.props.referencedMessage.message = message;
2022-12-08 18:05:56 +01:00
}
2023-11-04 12:42:42 +01:00
let fontGradient = BDFDB.ObjectUtils.is(color1);
if (!fontGradient) return;
e.returnvalue = BDFDB.ReactUtils.createElement("span", {
style: {
"--edited-user-color": fontGradient ? BDFDB.ColorUtils.convert(color1[0], "RGBA") : BDFDB.ColorUtils.convert(color1, "RGBA"),
[fontGradient ? "--edited-user-color-gradient" : ""]: fontGradient ? BDFDB.ColorUtils.createGradient(color1) : ""
},
children: e.returnvalue
});
}
processMessageUsername (e) {
if (!this.settings.places.chatWindow || !e.instance.props.message || !this.shouldChangeInChat(e.instance.props.message.channel_id)) return;
const author = e.instance.props.userOverride || e.instance.props.message.author;
if (!BDFDB.ArrayUtils.is(e.instance.props.decorations[0])) e.instance.props.decorations[0] = [e.instance.props.decorations[0]].filter(n => n);
this.injectBadge(e.instance.props.decorations[0], author.id, (BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, 0, {
2022-12-08 18:05:56 +01:00
tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy,
useRem: true
});
2018-10-11 10:21:26 +02:00
}
2020-09-19 20:49:33 +02:00
processMessageContent (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.chatWindow || !e.instance.props.message || !this.shouldChangeInChat(e.instance.props.message.channel_id)) return;
if (!e.returnvalue) {
if (!BDFDB.DiscordConstants.MessageTypeGroups.USER_MESSAGE.has(e.instance.props.message.type)) {
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, e.instance.props.message, {author: this.getUserData(e.instance.props.message.author.id, true, false, e.instance.props.message.author)}));
2020-09-19 20:49:33 +02:00
let data = changedUsers[e.instance.props.message.author.id];
2022-11-29 19:38:55 +01:00
if (data) {
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, e.instance.props.message.author.id) || {}).colorString || data.color1;
if (color1) message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
2020-10-20 21:57:17 +02:00
}
2022-11-29 19:38:55 +01:00
e.instance.props.message = message;
if (e.instance.props.children) e.instance.props.children.props.message = e.instance.props.message;
}
}
else if (e.instance.props.message.state != BDFDB.DiscordConstants.MessageStates.SEND_FAILED) {
let data = changedUsers[e.instance.props.message.author.id];
let messageColor = data && (data.color2 || (BDFDB.ObjectUtils.get(BDFDB.BDUtils.getPlugin("BetterRoleColors", true), "settings.modules.chat") && (data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, e.instance.props.message.author.id) || {}).colorString || data.color1)));
if (messageColor) {
if (BDFDB.ObjectUtils.is(messageColor)) e.returnvalue.props.children = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextGradientElement, {
gradient: BDFDB.ColorUtils.createGradient(messageColor),
children: e.returnvalue.props.children
});
else e.returnvalue.props.children = BDFDB.ReactUtils.createElement("span", {
style: Object.assign({}, e.returnvalue.props.style, {color: BDFDB.ColorUtils.convert(messageColor, "RGBA")}),
children: e.returnvalue.props.children
});
2020-09-19 20:49:33 +02:00
}
2020-02-07 15:16:40 +01:00
}
}
2020-09-19 20:49:33 +02:00
2021-07-29 00:36:40 +02:00
processThreadMessageAccessoryMessage (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.chatWindow || !e.instance.props.message || !this.shouldChangeInChat(e.instance.props.message.channel_id)) return;
e.instance.props.message = new BDFDB.DiscordObjects.Message(Object.assign({}, e.instance.props.message, {author: this.getUserData(e.instance.props.message.author.id)}));
}
processThreadCardDescription (e) {
if (!this.settings.places.chatWindow || !e.instance.props.channel || !changedUsers[e.instance.props.channel.ownerId] || !this.shouldChangeInChat(e.instance.props.channel.id)) return;
let ownerName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.threadcardstartedby]]});
if (!ownerName) return;
let data = changedUsers[e.instance.props.channel.ownerId];
ownerName.props.name = this.getUserData(e.instance.props.channel.ownerId).username;
ownerName.props.color = data.color1 && (data.useRoleColor && ownerName.props.color || BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(data.color1) ? data.color1[0] : data.color1, "HEX")) || ownerName.props.color;
2021-07-29 00:36:40 +02:00
}
2023-11-02 19:55:00 +01:00
processReactionsModalUser (e) {
2022-11-30 11:01:08 +01:00
if (!this.settings.places.reactions || !e.instance.props.user || !changedUsers[e.instance.props.user.id] || !this.shouldChangeInChat(e.instance.props.channel.id)) return;
let nickName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.messagereactionsmodalnickname]]});
if (nickName) this.changeUserColor(nickName, e.instance.props.user.id);
2022-11-30 11:21:39 +01:00
let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: ["size"]});
if (avatar) avatar.props.user = this.getUserData(e.instance.props.user.id);
2020-07-07 01:36:52 +02:00
}
2020-09-19 20:49:33 +02:00
2021-02-24 17:32:17 +01:00
processUserMention (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.mentions || !e.instance.props.userId || !changedUsers[e.instance.props.userId] || !this.shouldChangeInChat(e.instance.props.channelId)) return;
if (typeof e.returnvalue.props.children == "function") {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = renderChildren(...args);
this.changeMention(BDFDB.ReactUtils.findChild(children, {name: "Mention"}), changedUsers[e.instance.props.userId]);
return children;
}, "Error in Children Render of UserMention!", this);
2020-12-04 22:16:16 +01:00
}
2022-11-29 19:38:55 +01:00
else this.changeMention(BDFDB.ReactUtils.findChild(e.returnvalue, {name: "Mention"}), changedUsers[e.instance.props.userId]);
2020-12-04 22:16:16 +01:00
}
2021-02-24 17:32:17 +01:00
processRichUserMention (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.mentions || !e.instance.props.id || !changedUsers[e.instance.props.id] || !this.shouldChangeInChat(e.instance.props.channel && e.instance.props.channel.id)) return;
let data = changedUsers[e.instance.props.id];
let tooltipChildren = BDFDB.ObjectUtils.get(e, "returnvalue.props.text.props.children");
if (tooltipChildren) {
if (tooltipChildren[0] && tooltipChildren[0].props && tooltipChildren[0].props.user) tooltipChildren[0].props.user = this.getUserData(tooltipChildren[0].props.user.id);
if (data.name && typeof tooltipChildren[1] == "string") tooltipChildren[1] = data.name;
}
if (!data.name && !data.color1) return;
if (typeof e.returnvalue.props.children == "function") {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = renderChildren(...args);
this.changeMention(children, data);
return children;
}, "Error in Children Render of RichUserMention!", this);
2020-02-07 19:46:33 +01:00
}
2022-11-29 19:38:55 +01:00
else this.changeMention(e.returnvalue, data);
2020-02-07 19:46:33 +01:00
}
2020-12-04 22:16:16 +01:00
2020-12-04 22:29:17 +01:00
changeMention (mention, data) {
2021-05-20 16:44:45 +02:00
if (!mention) return;
2020-12-04 22:16:16 +01:00
if (data.name) {
2021-07-29 00:36:40 +02:00
const changeMentionName = (child, name) => {
if (!child) return;
if (BDFDB.ArrayUtils.is(child)) for (let i in child) {
if (typeof child[i] == "string" && child[i][0] == "@") {
if (child[i] == "@") child[parseInt(i) + 1] = data.name;
else child[i] = "@" + data.name;
}
else changeMentionName(child[i]);
}
else if (child.props && typeof child.props.children == "string" && child.props.children[0] == "@") child.props.children = "@" + data.name;
2022-04-16 19:22:30 +02:00
else if (child.props && child.props.children) changeMentionName(child.props.children);
2020-12-04 22:16:16 +01:00
};
2021-07-29 00:36:40 +02:00
changeMentionName(mention);
2020-12-04 22:16:16 +01:00
}
2022-05-26 15:01:24 +02:00
if (data.color1) {
mention.props.color = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(data.color1) ? data.color1[0] : data.color1, "INT");
2023-03-10 13:30:33 +01:00
mention.props["edited-mention-color"] = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(data.color1) ? data.color1[0] : data.color1, "RGBCOMP").slice(0, 3).join(",");
if (mention.props.children && mention.props.children.props) {
mention.props.children.props.color = mention.props.color;
mention.props.children.props["edited-mention-color"] = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(data.color1) ? data.color1[0] : data.color1, "RGBCOMP").slice(0, 3).join(",");
}
2022-05-26 15:01:24 +02:00
}
2020-12-04 22:16:16 +01:00
}
2023-03-10 13:30:33 +01:00
processMention (e) {
if (e.instance.props["edited-mention-color"]) e.returnvalue.props.style = Object.assign({}, e.returnvalue.props.style, {"--edited-mention-color": e.instance.props["edited-mention-color"]});
}
2019-01-26 22:45:19 +01:00
2020-10-27 16:25:26 +01:00
processChannelReply (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.chatWindow || !e.instance.props.reply || !e.instance.props.reply.message || !this.shouldChangeInChat(e.instance.props.reply.message.channel_id)) return;
if (!e.returnvalue) {
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, e.instance.props.reply.message, {author: this.getUserData(e.instance.props.reply.message.author.id)}));
let data = changedUsers[e.instance.props.reply.message.author.id];
if (data) {
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryStores.GuildMemberStore.getMember((BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.reply.message.channel_id) || {}).guild_id, e.instance.props.reply.message.author.id) || {}).colorString || data.color1;
if (color1) message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
2020-10-27 16:25:26 +01:00
}
2022-11-29 19:38:55 +01:00
e.instance.props.reply = Object.assign({}, e.instance.props.reply, {message: message});
}
else {
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.messagereplyname]]});
if (username) this.changeUserColor(username, e.instance.props.reply.message.author.id);
2020-10-27 16:25:26 +01:00
}
}
2020-09-19 20:49:33 +02:00
processMemberListItem (e) {
2023-06-21 11:34:51 +02:00
if (!this.settings.places.memberList || !e.instance.props.user || !this.shouldChangeInChat(e.instance.props.channel.id)) return;
2023-11-02 19:55:00 +01:00
e.instance.props.user = this.getUserData(e.instance.props.user.id);
let data = changedUsers[e.instance.props.user.id];
if (data) {
if (data.name) {
let member = BDFDB.LibraryStores.GuildMemberStore.getMember(e.instance.props.channel.guild_id, e.instance.props.user.id);
e.instance.props.nick = this.getUserNick(e.instance.props.user.id, member && member.nick || e.instance.props.user.globalName);
}
if (data.removeStatus || data.status || data.statusEmoji) {
e.instance.props.activities = [].concat(e.instance.props.activities).filter(n => n.type != BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS);
let activity = this.createCustomStatus(data);
if (activity) e.instance.props.activities.unshift(activity);
2020-02-17 13:16:17 +01:00
}
2022-11-29 19:38:55 +01:00
}
2023-11-02 19:55:00 +01:00
}
processNameContainer (e) {
if (!this.settings.places.memberList || !e.instance.props.user || !this.shouldChangeInChat(e.instance.props.channel.id)) return;
this.changeUserColor(e.instance.props.name, e.instance.props.user.id, {e: e, guildId: e.instance.props.channel.guild_id});
this.injectBadge(BDFDB.ObjectUtils.get(e.instance, "props.decorators.props.children"), e.instance.props.user.id, BDFDB.LibraryStores.SelectedGuildStore.getGuildId(), 2, {
tagClass: BDFDB.disCN.bottagmember
});
2019-03-27 19:18:10 +01:00
}
2019-01-26 22:45:19 +01:00
2021-03-20 12:25:14 +01:00
processAuditLogs (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.guildSettings || !e.instance.props.logs) return;
if (!BDFDB.PatchUtils.isPatched(this, e.instance, "renderUserQuickSelectItem")) BDFDB.PatchUtils.patch(this, e.instance, "renderUserQuickSelectItem", {after: e2 => {
if (!e2.methodArguments[0] || !e2.methodArguments[0].user || !changedUsers[e2.methodArguments[0].user.id]) return;
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e2.returnValue, {props: [["children", e2.methodArguments[0].label]]});
if (username) {
if (changedUsers[e2.methodArguments[0].user.id].name) username.props.children = changedUsers[e2.methodArguments[0].user.id].name;
this.changeUserColor(username, e2.methodArguments[0].user.id);
2022-11-29 19:38:55 +01:00
}
let avatar = BDFDB.ReactUtils.findChild(e2.returnValue, {props: [["className", BDFDB.disCN.selectfilterpopoutavatar]]});
if (avatar) avatar.props.src = this.getUserAvatar(e2.methodArguments[0].user.id);
}}, {noCache: true});
2021-03-20 12:25:14 +01:00
}
2022-11-29 19:38:55 +01:00
processAuditLogEntry (e) {
if (!this.settings.places.guildSettings || !e.instance.props.log) return;
if (e.instance.props.log.user) e.instance.props.log.user = this.getUserData(e.instance.props.log.user.id);
if (e.instance.props.log.target && e.instance.props.log.targetType == "USER") e.instance.props.log.target = this.getUserData(e.instance.props.log.target.id);
2020-02-07 15:16:40 +01:00
}
2019-09-04 12:34:02 +02:00
2022-11-29 19:38:55 +01:00
processGuildEmojis (e) {
if (!this.settings.places.guildSettings) return;
if (e.instance.props.staticEmojis) {
e.instance.props.staticEmojis = [].concat(e.instance.props.staticEmojis);
for (let i in e.instance.props.staticEmojis) e.instance.props.staticEmojis[i] = Object.assign({}, e.instance.props.staticEmojis[i], {user: this.getUserData(e.instance.props.staticEmojis[i].user.id)});
}
if (e.instance.props.animatedEmojis) {
e.instance.props.animatedEmojis = [].concat(e.instance.props.animatedEmojis);
for (let i in e.instance.props.animatedEmojis) e.instance.props.animatedEmojis[i] = Object.assign({}, e.instance.props.animatedEmojis[i], {user: this.getUserData(e.instance.props.animatedEmojis[i].user.id)});
2020-09-19 20:49:33 +02:00
}
2019-08-19 11:17:57 +02:00
}
2019-09-04 12:34:02 +02:00
2022-11-29 19:38:55 +01:00
processGuildMemberEntry (e) {
if (this.settings.places.guildSettings && e.instance.props.user) e.instance.props.user = this.getUserData(e.instance.props.user.id);
2020-09-19 20:49:33 +02:00
}
2019-09-04 12:34:02 +02:00
2022-11-29 19:38:55 +01:00
processGuildInvites (e) {
if (!this.settings.places.guildSettings || !e.instance.props.invites) return;
e.instance.props.invites = Object.assign({}, e.instance.props.invites);
for (let id in e.instance.props.invites) e.instance.props.invites[id] = new BDFDB.DiscordObjects.Invite(Object.assign({}, e.instance.props.invites[id], {inviter: this.getUserData(e.instance.props.invites[id].inviter.id)}));
}
2019-01-26 22:45:19 +01:00
2022-11-29 19:38:55 +01:00
processGuildBans (e) {
if (!this.settings.places.guildSettings || !e.instance.props.bans) return;
e.instance.props.bans = Object.assign({}, e.instance.props.bans);
for (let id in e.instance.props.bans) e.instance.props.bans[id] = Object.assign({}, e.instance.props.bans[id], {user: this.getUserData(e.instance.props.bans[id].user.id)});
2019-08-19 11:17:57 +02:00
}
2019-01-26 22:45:19 +01:00
2022-11-29 19:38:55 +01:00
processGuildInvitationRow (e) {
if (!this.settings.places.inviteList || !e.instance.props.user) return;
if (!e.returnvalue) e.instance.props.user = this.getUserData(e.instance.props.user.id);
else {
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.invitemodalinviterowname]]});
if (username) this.changeUserColor(username, e.instance.props.user.id);
2019-08-19 11:17:57 +02:00
}
}
2020-02-07 15:16:40 +01:00
2022-11-29 19:38:55 +01:00
processDirectMessageAddPopout (e) {
if (!this.settings.places.inviteList || !BDFDB.ArrayUtils.is(e.instance.props.results)) return;
for (let result of e.instance.props.results) result.user = this.getUserData(result.user.id);
}
2019-09-04 12:34:02 +02:00
2022-11-29 19:38:55 +01:00
processDirectMessageAddPopoutRow (e) {
if (!this.settings.places.inviteList || !e.instance.props.user) return;
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.dmaddpopoutnickname]]});
if (username) this.changeUserColor(username, e.instance.props.user.id);
2020-02-07 15:16:40 +01:00
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
processTypingUsers (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.typing || !BDFDB.ObjectUtils.is(e.instance.props.typingUsers) || !Object.keys(e.instance.props.typingUsers).length) return;
let users = Object.keys(e.instance.props.typingUsers).filter(id => id != BDFDB.UserUtils.me.id).filter(id => !BDFDB.LibraryStores.RelationshipStore.isBlocked(id)).map(id => BDFDB.LibraryStores.UserStore.getUser(id)).filter(n => n);
if (!users.length) return;
let typingText = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.typingtext]]});
if (typingText && BDFDB.ArrayUtils.is(typingText.props.children)) for (let child of typingText.props.children) if (child.type == "strong") {
let userId = (users.shift() || {}).id;
if (userId) {
let data = changedUsers[userId];
if (data && data.name) child.props.children = data.name;
this.changeUserColor(child, userId);
2020-02-07 15:16:40 +01:00
}
}
2019-01-02 09:58:59 +01:00
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
processDirectMessage (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.recentDms || !e.instance.props.channel || !e.instance.props.channel.isDM()) return;
let recipientId = e.instance.props.channel.getRecipientId();
if (!recipientId || !changedUsers[recipientId]) return;
2023-06-20 09:23:42 +02:00
let userData = this.getUserData(recipientId);
e.instance.props.channelName = userData.globalName || userData.username;
2022-11-29 19:38:55 +01:00
let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {filter: c => c && c.props && !isNaN(parseInt(c.props.id))});
if (avatar && typeof avatar.props.children == "function") {
let childrenRender = avatar.props.children;
avatar.props.children = BDFDB.TimeUtils.suppress((...args) => {
let renderedChildren = childrenRender(...args);
if (renderedChildren && renderedChildren.props) renderedChildren.props.icon = this.getUserAvatar(recipientId);
return renderedChildren;
}, "Error in Avatar Render of DirectMessage!", this);
2020-02-17 13:16:17 +01:00
}
2019-08-19 11:17:57 +02:00
}
2021-11-12 16:30:05 +01:00
2020-09-19 20:49:33 +02:00
processPrivateChannel (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.dmsList || !e.instance.props.user || !changedUsers[e.instance.props.user.id]) return;
if (!e.returnvalue) {
let data = changedUsers[e.instance.props.user.id];
if (data.removeStatus || data.status || data.statusEmoji) {
e.instance.props.activities = [].concat(e.instance.props.activities).filter(n => n.type != BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS);
let activity = this.createCustomStatus(changedUsers[e.instance.props.user.id]);
if (activity) e.instance.props.activities.unshift(activity);
2020-09-19 20:49:33 +02:00
}
2022-11-29 19:38:55 +01:00
}
else {
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);
2020-02-07 15:16:40 +01:00
}
2022-11-29 19:38:55 +01:00
else this._processPrivateChannel(e.instance, wrapper);
2019-08-19 11:17:57 +02:00
}
}
2019-09-04 12:34:02 +02:00
2021-11-12 16:30:05 +01:00
_processPrivateChannel (instance, returnvalue) {
2022-02-11 14:43:01 +01:00
const wrapper = returnvalue.props.avatar ? returnvalue : BDFDB.ReactUtils.findChild(returnvalue, {props: ["avatar"]});
2022-02-11 15:49:25 +01:00
if (!wrapper) return;
2023-06-20 09:23:42 +02:00
let userData = this.getUserData(instance.props.user.id);
wrapper.props.name = BDFDB.ReactUtils.createElement("span", {children: userData.globalName || userData.username});
2022-02-11 14:43:01 +01:00
this.changeUserColor(wrapper.props.name, instance.props.user.id, {modify: BDFDB.ObjectUtils.extract(Object.assign({}, instance.props, instance.state), "hovered", "selected", "hasUnreadMessages", "muted")});
if (wrapper.props.avatar) wrapper.props.avatar.props.src = this.getUserAvatar(instance.props.user.id);
wrapper.props.decorators = [wrapper.props.decorators].flat(10);
this.injectBadge(wrapper.props.decorators, instance.props.user.id, null, 1);
2021-11-12 16:30:05 +01:00
}
2022-11-29 19:38:55 +01:00
processQuickSwitcher (e) {
if (!e.instance.props.query || e.instance.props.queryMode && e.instance.props.queryMode != BDFDB.DiscordConstants.AutocompleterResultTypes.USER) return;
for (let id in changedUsers) if (changedUsers[id] && changedUsers[id].name && changedUsers[id].name.toLocaleLowerCase().indexOf(e.instance.props.query.toLocaleLowerCase()) > -1 && !e.instance.props.results.find(n => n.record && n.record.id == id && n.type == BDFDB.DiscordConstants.AutocompleterResultTypes.USER)) {
let user = BDFDB.LibraryStores.UserStore.getUser(id);
if (user) e.instance.props.results.splice(1, 0, {
2023-06-30 10:55:35 +02:00
comparator: user.isPomelo() ? user.username : `${user.username}#${user.discriminator}`,
2022-11-29 19:38:55 +01:00
record: user,
score: 30000,
type: BDFDB.DiscordConstants.AutocompleterResultTypes.USER
});
2022-08-29 15:04:18 +02:00
}
}
2020-09-19 20:49:33 +02:00
processQuickSwitchUserResult (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.quickSwitcher || !e.instance.props.user) return;
if (!e.returnvalue) e.instance.props.user = this.getUserData(e.instance.props.user.id);
else {
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.quickswitchresultmatch]]});
if (username) {
2022-11-29 19:38:55 +01:00
let data = changedUsers[e.instance.props.user.id];
2023-06-20 09:23:42 +02:00
if (data && data.name) username.props.children = data.name;
this.changeUserColor(username, e.instance.props.user.id, {modify: BDFDB.ObjectUtils.extract(e.instance.props, "focused", "unread", "mentions")});
2020-09-19 20:49:33 +02:00
}
}
2019-08-19 11:17:57 +02:00
}
2019-01-26 22:45:19 +01:00
2022-11-29 19:38:55 +01:00
processSearchPopoutOption (e) {
if (!this.settings.places.searchPopout || !e.instance.props.result || !e.instance.props.result.user || !changedUsers[e.instance.props.result.user.id]) return;
if (!e.returnvalue) e.instance.props.result = Object.assign({}, e.instance.props.result, {user: this.getUserData(e.instance.props.result.user.id)});
else {
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.searchpopoutdisplayednick]]});
if (username) {
2020-09-19 20:49:33 +02:00
let data = changedUsers[e.instance.props.result.user.id];
2023-06-20 09:23:42 +02:00
if (data && data.name) username.props.children = data.name;
this.changeUserColor(username, e.instance.props.result.user.id);
2020-02-07 15:16:40 +01:00
}
2021-09-27 21:25:41 +02:00
let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.searchpopoutdisplayavatar]]});
if (avatar) avatar.props.src = this.getUserAvatar(e.instance.props.result.user.id);
2019-08-19 11:17:57 +02:00
}
2019-04-23 08:09:58 +02:00
}
2020-09-19 20:49:33 +02:00
processIncomingCallModal (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.dmCalls || !e.instance.props.channel) return;
let user = BDFDB.LibraryStores.UserStore.getUser(e.instance.props.channel.id);
if (!user) {
let channel = BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.channel.id);
if (channel && channel.isDM()) user = BDFDB.LibraryStores.UserStore.getUser(channel.recipients[0]);
2020-09-19 20:49:33 +02:00
}
2022-11-29 19:38:55 +01:00
if (user) {
2023-06-20 09:23:42 +02:00
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.callincomingtitle]]});
if (username) {
2022-11-29 19:38:55 +01:00
let data = changedUsers[user.id];
2023-06-20 09:23:42 +02:00
if (data && data.name) username.props.children = data.name;
this.changeUserColor(username, user.id);
2022-11-29 19:38:55 +01:00
}
let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.callincomingicon]]});
if (avatar) avatar.props.src = this.getUserAvatar(user.id);
2021-11-03 17:58:40 +01:00
}
}
processParticipantsForSelectedParticipant (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.voiceChat) return;
let popout = BDFDB.ReactUtils.findChild(e.returnvalue, {filter: n => n && n.props && typeof n.props.renderPopout == "function"});
if (!popout) return;
let renderPopout = popout.props.renderPopout;
popout.props.renderPopout = BDFDB.TimeUtils.suppress((...args) => {
let renderedPopout = renderPopout(...args);
renderedPopout.props.users = [].concat(renderedPopout.props.users);
for (let i in renderedPopout.props.users) if (renderedPopout.props.users[i]) renderedPopout.props.users[i] = this.getUserData(renderedPopout.props.users[i].id);
return renderedPopout;
});
if (typeof popout.props.children == "function") {
let renderChildren = popout.props.children;
popout.props.children = BDFDB.TimeUtils.suppress((...args) => {
let renderedChildren = renderChildren(...args);
for (let viewer of renderedChildren.props.children) viewer.props.src = this.getUserAvatar(viewer.key);
return renderedChildren;
});
2021-11-03 17:58:40 +01:00
}
}
2022-03-19 19:01:43 +01:00
processChannelCall (e) {
2022-11-29 19:38:55 +01:00
if (!this.settings.places.voiceChat || !BDFDB.ArrayUtils.is(e.instance.props.participants)) return;
e.instance.props.participants = [].concat(e.instance.props.participants);
for (let i in e.instance.props.participants) if (e.instance.props.participants[i] && e.instance.props.participants[i].user) e.instance.props.participants[i] = Object.assign({}, e.instance.props.participants[i], {user: this.getUserData(e.instance.props.participants[i].user.id)});
2020-02-07 15:16:40 +01:00
}
2020-09-19 20:49:33 +02:00
2022-03-19 19:01:43 +01:00
processChannelCallGrid (e) {
this.processChannelCall(e);
}
2022-11-29 19:38:55 +01:00
processChannelCallVideoParticipants (e) {
2022-03-19 19:01:43 +01:00
this.processChannelCall(e);
2020-03-28 15:08:45 +01:00
}
2020-09-19 20:49:33 +02:00
processPictureInPictureVideo (e) {
2022-11-29 19:38:55 +01:00
if (!e.instance.props.backgroundKey) return;
let user = BDFDB.LibraryStores.UserStore.getUser(e.instance.props.backgroundKey);
if (!user) return;
2023-06-20 09:23:42 +02:00
let userData = this.getUserData(user.id);
e.instance.props.title = userData.globalName || userData.username;
2022-11-29 19:38:55 +01:00
let videoBackground = BDFDB.ReactUtils.findChild(e.instance.props.children, {name: "VideoBackground"});
if (videoBackground && videoBackground.props.src) videoBackground.props.src = this.getUserAvatar(user.id);
2020-06-28 09:41:02 +02:00
}
2019-09-04 12:34:02 +02:00
2020-09-19 20:49:33 +02:00
processUserSummaryItem (e) {
2022-11-29 19:38:55 +01:00
if (!BDFDB.ArrayUtils.is(e.instance.props.users)) return;
for (let i in e.instance.props.users) if (e.instance.props.users[i]) e.instance.props.users[i] = this.getUserData(e.instance.props.users[i].id);
2020-02-29 20:02:20 +01:00
}
2021-01-06 12:38:36 +01:00
changeAppTitle () {
2022-09-27 20:19:49 +02:00
let channel = BDFDB.LibraryStores.ChannelStore.getChannel(BDFDB.LibraryStores.SelectedChannelStore.getChannelId());
2020-09-19 20:49:33 +02:00
let title = document.head.querySelector("title");
2022-04-21 19:42:18 +02:00
if (title && channel && channel.isDM() && (document.location.href || "").indexOf(channel.id) > -1) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(channel.recipients[0]);
2023-06-20 09:23:42 +02:00
let userData = user && this.getUserData(user.id, this.settings.places.appTitle);
if (userData) BDFDB.DOMUtils.setText(title, "@" + (userData.globalName || userData.username));
2020-09-19 20:49:33 +02:00
}
2020-02-07 15:16:40 +01:00
}
2020-09-19 20:49:33 +02:00
2021-07-29 00:36:40 +02:00
shouldChangeInChat (channelId) {
2021-05-20 16:44:45 +02:00
if (this.settings.types.servers && this.settings.types.dms) return true;
2022-09-27 20:19:49 +02:00
let channel = BDFDB.LibraryStores.ChannelStore.getChannel(channelId || BDFDB.LibraryStores.SelectedChannelStore.getChannelId());
2021-01-13 18:54:21 +01:00
let isDm = channel && (channel.isDM() || channel.isGroupDM());
2021-05-20 16:44:45 +02:00
if (channel && (this.settings.types.servers && !isDm || this.settings.types.dms && isDm)) return true;
2021-01-13 18:54:21 +01:00
return false;
}
2020-09-19 20:49:33 +02:00
changeUserColor (child, userId, options = {}) {
2022-07-11 14:51:22 +02:00
if (!BDFDB.ReactUtils.isValidElement(child)) return;
let data = changedUsers[userId] || {};
if (data.color1) {
2022-12-08 18:05:56 +01:00
let childProp = child.props.children ? "children" : child.props.name ? "name" : "text";
if (!child.props[childProp]) return;
2022-09-27 16:53:10 +02:00
let color1 = data.color1 && data.useRoleColor && options.guildId && (BDFDB.LibraryStores.GuildMemberStore.getMember(options.guildId, userId) || {}).colorString || data.color1;
2022-07-11 14:51:22 +02:00
let fontColor = options.modify && !(data.useRoleColor && options.guildId) ? this.chooseColor(color1, options.modify) : color1;
let fontGradient = BDFDB.ObjectUtils.is(fontColor);
if (BDFDB.ObjectUtils.is(child.props.style)) delete child.props.style.color;
2022-09-27 16:53:10 +02:00
if (child.props[childProp].props && BDFDB.LibraryStores.AccessibilityStore.roleStyle != "dot") delete child.props[childProp].props.color;
2022-07-11 14:51:22 +02:00
child.props[childProp] = BDFDB.ReactUtils.createElement("span", {
style: {
color: fontGradient ? BDFDB.ColorUtils.convert(fontColor[0], "RGBA") : BDFDB.ColorUtils.convert(fontColor, "RGBA")
},
children: fontGradient ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextGradientElement, {
gradient: BDFDB.ColorUtils.createGradient(fontColor),
children: child.props[childProp]
}) : child.props[childProp]
});
2020-02-07 15:16:40 +01:00
}
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
chooseColor (color, config = {}) {
if (color) {
if (BDFDB.ObjectUtils.is(config)) {
if (config.mentions || config.focused || config.hovered || config.selected || config.unread || config.hasUnreadMessages || config.speaking) color = BDFDB.ColorUtils.change(color, 0.5);
else if (config.muted || config.locked) color = BDFDB.ColorUtils.change(color, -0.5);
}
return color;
}
2020-09-19 20:49:33 +02:00
return null;
2020-02-07 15:16:40 +01:00
}
2020-09-19 20:49:33 +02:00
2020-10-29 17:23:26 +01:00
getUserData (userId, change = true, keepName = false, fallbackData) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(userId);
2023-06-20 09:23:42 +02:00
if (!user && BDFDB.ObjectUtils.is(fallbackData) || user && BDFDB.ObjectUtils.is(fallbackData) && (user.username != fallbackData.username || user.globalName != fallbackData.globalName)) user = fallbackData;
2020-09-19 20:49:33 +02:00
if (!user) return new BDFDB.DiscordObjects.User({});
let data = change && changedUsers[user.id];
if (data) {
2023-04-20 11:38:12 +02:00
let nativeObject = new BDFDB.DiscordObjects.User(user);
let newUserObject = BDFDB.ObjectUtils.copy(nativeObject);
2023-11-02 19:55:00 +01:00
newUserObject.toString = _ => newUserObject.username;
2023-06-20 09:23:42 +02:00
if (nativeObject.globalName) newUserObject.globalName = !keepName && data.name || nativeObject.globalName;
else {
newUserObject.username = !keepName && data.name || nativeObject.username;
newUserObject.usernameNormalized = !keepName && data.name && data.name.toLowerCase() || nativeObject.usernameNormalized;
}
2020-09-19 20:49:33 +02:00
if (data.removeIcon) {
newUserObject.avatar = null;
newUserObject.avatarURL = null;
2021-11-09 17:02:30 +01:00
newUserObject.getAvatarSource = _ => null;
2021-06-01 17:25:52 +02:00
newUserObject.getAvatarURL = _ => null;
2021-10-18 19:00:51 +02:00
newUserObject.guildMemberAvatars = {};
2020-09-19 20:49:33 +02:00
}
else if (data.url) {
newUserObject.avatar = data.url;
newUserObject.avatarURL = data.url;
2021-11-09 17:02:30 +01:00
newUserObject.getAvatarSource = _ => data.url;
2021-06-01 17:25:52 +02:00
newUserObject.getAvatarURL = _ => data.url;
2021-10-18 19:00:51 +02:00
newUserObject.guildMemberAvatars = {};
2021-06-01 17:25:52 +02:00
}
2020-09-19 20:49:33 +02:00
return newUserObject;
}
2020-09-19 20:49:33 +02:00
return new BDFDB.DiscordObjects.User(user);
}
2020-09-19 20:49:33 +02:00
2021-11-03 15:57:22 +01:00
getUserNick (userId, nick, change = true) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(userId);
2021-11-03 15:57:22 +01:00
if (!user) return "";
let data = change && changedUsers[user.id];
if (data) return (data.useServerNick && nick || data.name && [data.name, data.showServerNick && nick && `(${nick})` || data.showAccountName && user.username && `(${user.username})`].filter(n => n).join(" ")) || nick || "";
return "";
}
2020-09-19 20:49:33 +02:00
getUserAvatar (userId, change = true) {
2022-09-27 16:53:10 +02:00
let user = BDFDB.LibraryStores.UserStore.getUser(userId);
2020-09-19 20:49:33 +02:00
if (!user) return "";
let data = change && changedUsers[user.id];
if (data) {
if (data.removeIcon) return "";
else if (data.url) return data.url;
}
return BDFDB.LibraryModules.IconUtils.getUserAvatarURL(user);
2020-02-07 15:16:40 +01:00
}
2020-09-19 20:49:33 +02:00
injectBadge (children, userId, guildId, insertIndex, config = {}) {
if (!BDFDB.ArrayUtils.is(children) || !userId) return;
let data = changedUsers[userId];
if (data && data.tag) {
2022-09-27 16:53:10 +02:00
let memberColor = data.ignoreTagColor && (BDFDB.LibraryStores.GuildMemberStore.getMember(guildId, userId) || {}).colorString;
2020-09-19 20:49:33 +02:00
let fontColor = !config.inverted ? data.color4 : (memberColor || data.color3);
let backgroundColor = !config.inverted ? (memberColor || data.color3) : data.color4;
let fontGradient = BDFDB.ObjectUtils.is(fontColor);
children.splice(insertIndex, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.BotTag, {
className: config.tagClass,
useRemSizes: config.useRem,
invertColor: config.inverted,
style: {
background: BDFDB.ObjectUtils.is(backgroundColor) ? BDFDB.ColorUtils.createGradient(backgroundColor) : BDFDB.ColorUtils.convert(backgroundColor, "RGBA"),
color: fontGradient ? BDFDB.ColorUtils.convert(fontColor[0], "RGBA") : BDFDB.ColorUtils.convert(fontColor, "RGBA")
},
tag: fontGradient ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextGradientElement, {
gradient: BDFDB.ColorUtils.createGradient(fontColor),
children: data.tag
}) : data.tag
}));
}
2020-02-07 15:16:40 +01:00
}
2020-09-19 20:49:33 +02:00
createCustomStatus (data) {
return !BDFDB.ObjectUtils.is(data) || data.removeStatus ? null : {
created_at: (new Date()).getTime().toString(),
emoji: data.statusEmoji,
id: "custom",
name: "Custom Status",
state: data.status,
2021-01-23 22:15:48 +01:00
type: BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS
2020-09-19 20:49:33 +02:00
}
2020-02-17 13:16:17 +01:00
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
openUserSettingsModal (user) {
let data = changedUsers[user.id] || {};
2021-01-29 19:48:09 +01:00
let newData = Object.assign({}, data);
2022-09-27 16:53:10 +02:00
let member = BDFDB.LibraryStores.GuildMemberStore.getMember(BDFDB.LibraryStores.SelectedGuildStore.getGuildId(), user.id) || {};
let activity = BDFDB.LibraryStores.PresenceStore.getApplicationActivity(user.id);
2020-09-19 20:49:33 +02:00
2023-03-11 13:28:44 +01:00
let avatarInput, bannerInput, statusEmojiInput, statusInput, colorPicker3, colorPicker4, colorPicker5, colorPicker6, colorPicker7;
2021-01-29 19:48:09 +01:00
2020-09-19 20:49:33 +02:00
BDFDB.ModalUtils.open(this, {
2021-06-01 17:25:52 +02:00
size: "LARGE",
header: this.labels.modal_header,
2023-06-20 09:23:42 +02:00
subHeader: member.nick || user.globalName || user.username,
2020-09-19 20:49:33 +02:00
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, {
tab: this.labels.modal_tabheader1,
2020-09-19 20:49:33 +02:00
children: [
2021-04-23 12:01:44 +02:00
BDFDB.ReactUtils.createElement("div", {
2021-11-03 15:57:22 +01:00
className: BDFDB.disCN.marginbottom8,
2021-04-23 12:01:44 +02:00
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom8,
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
2021-11-03 15:57:22 +01:00
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginreset,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2021-11-03 15:57:22 +01:00
children: this.labels.modal_username
})
2021-04-23 12:01:44 +02:00
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
value: data.name,
2023-06-20 09:23:42 +02:00
placeholder: member.nick || user.globalName || user.username,
2021-04-23 12:01:44 +02:00
autoFocus: true,
2021-11-03 15:57:22 +01:00
onChange: value => newData.name = value
})
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom20,
justify: BDFDB.LibraryComponents.Flex.Justify.END,
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
margin: 0,
grow: 0,
label: this.labels.modal_showaccountname,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2021-11-03 15:57:22 +01:00
value: data.showAccountName,
onChange: value => newData.showAccountName = value
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
margin: 0,
grow: 0,
label: this.labels.modal_showservernick,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2021-11-03 15:57:22 +01:00
value: data.showServerNick,
onChange: value => newData.showServerNick = value
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
margin: 0,
grow: 0,
label: this.labels.modal_useservernick,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2021-11-03 15:57:22 +01:00
value: data.useServerNick,
onChange: value => newData.useServerNick = value
2021-04-23 12:01:44 +02:00
})
]
2020-09-19 20:49:33 +02:00
}),
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.marginbottom20,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom8,
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginreset,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
children: this.labels.modal_useravatar
2020-09-19 20:49:33 +02:00
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
2020-10-14 21:08:41 +02:00
margin: 0,
2020-09-19 20:49:33 +02:00
grow: 0,
label: BDFDB.LanguageUtils.LanguageStrings.REMOVE,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2020-09-19 20:49:33 +02:00
value: data.removeIcon,
2021-01-29 19:48:09 +01:00
onChange: value => {
newData.removeIcon = value;
if (value) {
delete avatarInput.props.success;
delete avatarInput.props.errorMessage;
avatarInput.props.disabled = true;
BDFDB.ReactUtils.forceUpdate(avatarInput);
}
else {
avatarInput.props.disabled = false;
2021-11-03 15:57:22 +01:00
this.checkUrl(avatarInput.props.value, avatarInput).then(returnValue => newData.url = returnValue);
2020-09-19 20:49:33 +02:00
}
2020-02-17 13:16:17 +01:00
}
2020-02-18 11:39:32 +01:00
})
2020-09-19 20:49:33 +02:00
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
success: !data.removeIcon && data.url,
maxLength: 100000000000000000000,
value: data.url,
placeholder: BDFDB.UserUtils.getAvatar(user.id),
disabled: data.removeIcon,
2021-01-29 19:48:09 +01:00
ref: instance => {if (instance) avatarInput = instance;},
2023-03-11 13:28:44 +01:00
onChange: (value, instance) => this.checkUrl(value, instance).then(returnValue => newData.url = returnValue)
2021-06-01 17:25:52 +02:00
})
]
}),
2020-09-19 20:49:33 +02:00
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.marginbottom20,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom8,
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginreset,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2020-09-19 20:49:33 +02:00
children: BDFDB.LanguageUtils.LanguageStrings.CUSTOM_STATUS
2020-02-18 11:39:32 +01:00
}),
2020-09-19 20:49:33 +02:00
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
2020-10-14 21:08:41 +02:00
margin: 0,
2020-09-19 20:49:33 +02:00
grow: 0,
label: BDFDB.LanguageUtils.LanguageStrings.REMOVE,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2020-09-19 20:49:33 +02:00
value: data.removeStatus,
2021-01-29 19:48:09 +01:00
onChange: value => {
newData.removeStatus = value;
statusInput.props.disabled = value;
BDFDB.ReactUtils.forceUpdate(statusInput);
2020-02-18 11:39:32 +01:00
}
2020-09-19 20:49:33 +02:00
})
]
}),
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.emojiinputcontainer,
children: [
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.emojiinputbuttoncontainer,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.EmojiPickerButton, {
emoji: data.statusEmoji,
2021-01-29 19:48:09 +01:00
allowManagedEmojis: true,
2021-06-23 20:38:27 +02:00
allowManagedEmojisUsage: true,
2021-01-29 19:48:09 +01:00
ref: instance => {if (instance) statusEmojiInput = instance;},
2021-11-03 15:57:22 +01:00
onSelect: value => newData.statusEmoji = value
2020-09-19 20:49:33 +02:00
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
inputClassName: BDFDB.disCN.emojiinput,
maxLength: 100000000000000000000,
value: data.status,
2021-01-23 22:15:48 +01:00
placeholder: activity && activity.type == BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS && activity.state || "",
2021-01-29 19:48:09 +01:00
disabled: data.removeStatus,
ref: instance => {if (instance) statusInput = instance;},
2021-11-03 15:57:22 +01:00
onChange: value => newData.status = value
2020-09-19 20:49:33 +02:00
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
size: BDFDB.LibraryComponents.Button.Sizes.NONE,
look: BDFDB.LibraryComponents.Button.Looks.BLANK,
className: BDFDB.disCN.emojiinputclearbutton,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.emojiinputclearicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.CLOSE_CIRCLE
}),
2021-01-29 19:48:09 +01:00
onClick: _ => {
newData.status = "";
newData.statusEmoji = null;
statusInput.props.value = "";
delete statusEmojiInput.props.emoji;
BDFDB.ReactUtils.forceUpdate(statusInput, statusEmojiInput);
2020-09-19 20:49:33 +02:00
}
})
]
})
]
2020-02-07 15:16:40 +01:00
})
2020-09-19 20:49:33 +02:00
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, {
tab: this.labels.modal_tabheader2,
2020-09-19 20:49:33 +02:00
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: this.labels.modal_colorpicker1,
2020-09-19 20:49:33 +02:00
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color1,
2021-11-03 15:57:22 +01:00
onColorChange: value => newData.color1 = value
2020-09-19 20:49:33 +02:00
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: this.labels.modal_colorpicker2,
2020-09-19 20:49:33 +02:00
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color2,
2021-11-03 15:57:22 +01:00
onColorChange: value => newData.color2 = value
2020-09-19 20:49:33 +02:00
})
2020-10-06 11:39:26 +02:00
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
2020-10-14 21:08:41 +02:00
margin: 20,
label: this.labels.modal_userolecolor,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2021-01-29 19:48:09 +01:00
value: data.useRoleColor,
2021-11-03 15:57:22 +01:00
onChange: value => newData.useRoleColor = value
2020-02-07 15:16:40 +01:00
})
2020-09-19 20:49:33 +02:00
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, {
tab: this.labels.modal_tabheader3,
2020-09-19 20:49:33 +02:00
children: [
2023-03-11 13:28:44 +01:00
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: this.labels.modal_usertag,
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
value: data.tag,
onChange: value => newData.tag = value
})
}),
2020-09-19 20:49:33 +02:00
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: this.labels.modal_colorpicker3,
2020-09-19 20:49:33 +02:00
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color3,
2021-01-29 19:48:09 +01:00
disabled: data.ignoreTagColor,
ref: instance => {if (instance) colorPicker3 = instance;},
2021-11-03 15:57:22 +01:00
onColorChange: value => newData.color3 = value
2020-09-19 20:49:33 +02:00
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: this.labels.modal_colorpicker4,
2020-09-19 20:49:33 +02:00
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color4,
2021-01-29 19:48:09 +01:00
disabled: data.ignoreTagColor,
ref: instance => {if (instance) colorPicker4 = instance;},
2021-11-03 15:57:22 +01:00
onColorChange: value => newData.color4 = value
2020-09-19 20:49:33 +02:00
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
2020-10-14 21:08:41 +02:00
margin: 20,
label: this.labels.modal_ignoretagcolor,
2022-11-22 01:30:30 +01:00
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
2020-09-19 20:49:33 +02:00
value: data.ignoreTagColor,
2021-01-29 19:48:09 +01:00
onChange: value => {
newData.ignoreTagColor = value;
colorPicker3.props.disabled = value;
colorPicker4.props.disabled = value;
BDFDB.ReactUtils.forceUpdate(colorPicker3, colorPicker4);
2020-09-19 20:49:33 +02:00
}
2020-02-07 15:16:40 +01:00
})
2020-09-19 20:49:33 +02:00
]
2023-03-11 13:28:44 +01:00
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, {
tab: BDFDB.LibraryModules.LanguageStore.Messages.USER_SETTINGS_PROFILE_THEME,
children: [
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.marginbottom20,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.marginbottom8,
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginreset,
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
children: BDFDB.LanguageUtils.LanguageStrings.USER_SETTINGS_PROFILE_BANNER
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
margin: 0,
grow: 0,
label: BDFDB.LanguageUtils.LanguageStrings.REMOVE,
tag: BDFDB.LibraryComponents.FormComponents.FormTags.H5,
value: data.removeBanner,
onChange: value => {
newData.removeBanner = value;
if (value) {
delete bannerInput.props.success;
delete bannerInput.props.errorMessage;
bannerInput.props.disabled = true;
BDFDB.ReactUtils.forceUpdate(bannerInput);
}
else {
bannerInput.props.disabled = false;
this.checkUrl(bannerInput.props.value, bannerInput).then(returnValue => newData.banner = returnValue);
}
}
})
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
success: !data.removeBanner && data.banner,
maxLength: 100000000000000000000,
value: data.banner,
placeholder: BDFDB.UserUtils.getBanner(user.id),
ref: instance => {if (instance) bannerInput = instance;},
onChange: (value, instance) => this.checkUrl(value, instance).then(returnValue => newData.banner = returnValue)
})
]
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: BDFDB.LibraryModules.LanguageStore.Messages.USER_SETTINGS_BANNER_COLOR_TITLE,
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color5,
pickerConfig: {
alpha: false,
gradient: false
},
ref: instance => {if (instance) colorPicker5 = instance;},
onColorChange: value => newData.color5 = value
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: BDFDB.LibraryModules.LanguageStore.Messages.USER_SETTINGS_PROFILE_THEME_PRIMARY,
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color6,
pickerConfig: {
alpha: false,
gradient: false
},
ref: instance => {if (instance) colorPicker6 = instance;},
onColorChange: value => newData.color6 = value
})
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: BDFDB.LibraryModules.LanguageStore.Messages.USER_SETTINGS_PROFILE_THEME_ACCENT,
className: BDFDB.disCN.marginbottom20,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ColorSwatches, {
color: data.color7,
pickerConfig: {
alpha: false,
gradient: false
},
ref: instance => {if (instance) colorPicker7 = instance;},
onColorChange: value => newData.color7 = value
})
}),
]
2020-09-19 20:49:33 +02:00
})
],
buttons: [{
contents: BDFDB.LanguageUtils.LanguageStrings.SAVE,
color: "BRAND",
close: true,
2021-01-29 19:48:09 +01:00
onClick: _ => {
newData.url = !newData.removeIcon ? newData.url : "";
newData.status = !newData.removeStatus ? newData.status : "";
newData.statusEmoji = !newData.removeStatus ? newData.statusEmoji : null;
2020-02-07 15:16:40 +01:00
2020-09-19 20:49:33 +02:00
let changed = false;
2021-01-29 19:48:09 +01:00
if (Object.keys(newData).every(key => newData[key] == null || newData[key] == false) && (changed = true)) {
BDFDB.DataUtils.remove(this, "users", user.id);
}
else if (!BDFDB.equals(newData, data) && (changed = true)) {
BDFDB.DataUtils.save(newData, this, "users", user.id);
}
2020-09-19 20:49:33 +02:00
if (changed) this.forceUpdateAll();
}
}]
});
2020-02-07 15:16:40 +01:00
}
2020-09-19 20:49:33 +02:00
checkUrl (url, instance) {
2021-01-29 19:48:09 +01:00
return new Promise(callback => {
BDFDB.TimeUtils.clear(instance.checkTimeout);
url = url && url.trim();
if (!url || instance.props.disabled) {
delete instance.props.success;
delete instance.props.errorMessage;
callback("");
BDFDB.ReactUtils.forceUpdate(instance);
}
2022-12-01 21:38:21 +01:00
else if (url.indexOf("data:") == 0) {
instance.props.success = true;
delete instance.props.errorMessage;
callback(url);
}
2022-11-29 19:38:55 +01:00
else instance.checkTimeout = BDFDB.TimeUtils.timeout(_ => BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}}, (error, response, result) => {
delete instance.checkTimeout;
if (instance.props.disabled) {
delete instance.props.success;
delete instance.props.errorMessage;
callback("");
}
else if (response && response.headers["content-type"] && response.headers["content-type"].indexOf("image") != -1) {
instance.props.success = true;
delete instance.props.errorMessage;
callback(url);
}
else {
delete instance.props.success;
instance.props.errorMessage = this.labels.modal_invalidurl;
callback("");
}
BDFDB.ReactUtils.forceUpdate(instance);
}), 1000);
2021-01-29 19:48:09 +01:00
});
2020-02-07 15:16:40 +01:00
}
2020-07-26 17:02:25 +02:00
2021-01-06 12:38:36 +01:00
setLabelsByLanguage () {
2020-09-19 20:49:33 +02:00
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Наистина ли искате да нулирате този потребител?",
confirm_resetall: "Наистина ли искате да нулирате всички потребители?",
context_localusersettings: "Локални потребителски настройки",
2020-12-22 20:38:51 +01:00
modal_colorpicker1: "Име Цвят",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Цвят на съобщението",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Цвят на маркера",
modal_colorpicker4: "Цвят на шрифта",
modal_header: "Локални потребителски настройки",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Използвайте Цвят на ролята",
modal_invalidurl: "Невалиден адрес",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Покажи име",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Показване на псевдонима",
modal_tabheader1: "Потребител",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Име Цвят",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Етикет",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Аватар",
modal_username: "Локално потребителско име",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Не презаписвайте цвета на ролята",
modal_usertag: "Етикет",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Не презаписвайте псевдонимите",
submenu_resetsettings: "Нулиране на потребителя",
submenu_usersettings: "Промяна на настройките"
2020-09-19 20:49:33 +02:00
};
2021-06-01 17:25:52 +02:00
case "cs": // Czech
return {
confirm_reset: "Opravdu chcete tohoto uživatele resetovat?",
confirm_resetall: "Opravdu chcete resetovat všechny uživatele?",
context_localusersettings: "Místní nastavení uživatele",
modal_colorpicker1: "Název Barva",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Barva zprávy",
2021-06-01 17:25:52 +02:00
modal_colorpicker3: "Barva značky",
modal_colorpicker4: "Barva fontu",
modal_header: "Místní nastavení uživatele",
modal_ignoretagcolor: "Použijte barvu role",
modal_invalidurl: "Neplatná URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Zobrazit jméno",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Zobrazit přezdívku",
modal_tabheader1: "Uživatel",
modal_tabheader2: "Název Barva",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Štítek",
2021-06-01 17:25:52 +02:00
modal_useravatar: "Avatar",
modal_username: "Místní uživatelské jméno",
modal_userolecolor: "Nepřepisujte barvu role",
modal_usertag: "Štítek",
modal_useservernick: "Nepřepisujte přezdívky",
submenu_resetsettings: "Obnovit uživatele",
submenu_usersettings: "Změnit nastavení"
};
case "da": // Danish
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Er du sikker på, at du vil nulstille denne bruger?",
confirm_resetall: "Er du sikker på, at du vil nulstille alle brugere?",
context_localusersettings: "Lokale brugerindstillinger",
modal_colorpicker1: "Navnfarve",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Beskedfarve",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Tagfarve",
modal_colorpicker4: "Skriftfarve",
modal_header: "Lokale brugerindstillinger",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Brug rollefarve",
modal_invalidurl: "Ugyldig URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Vis navn",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Vis kaldenavn",
modal_tabheader1: "Bruger",
modal_tabheader2: "Navnfarve",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Tag",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Lokalt brugernavn",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Overskriv ikke rollefarven",
modal_usertag: "Tag",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Overskriv ikke kælenavne",
submenu_resetsettings: "Nulstil bruger",
submenu_usersettings: "Ændre indstillinger"
2020-09-19 20:49:33 +02:00
};
case "de": // German
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Möchtest du diesen Benutzer wirklich zurücksetzen?",
confirm_resetall: "Möchtest du wirklich alle Benutzer zurücksetzen?",
context_localusersettings: "Lokale Benutzereinstellungen",
modal_colorpicker1: "Namensfarbe",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Nachrichtenfarbe",
2023-03-11 13:28:44 +01:00
modal_colorpicker3: "Abzeichenfarbe",
modal_colorpicker4: "Schriftfarbe",
modal_header: "Lokale Benutzereinstellungen",
modal_ignoretagcolor: "Rollenfarbe verwenden",
modal_invalidurl: "Ungültige URL",
2023-06-20 09:23:42 +02:00
modal_showaccountname: "Namen anzeigen",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Nicknamen anzeigen",
modal_tabheader1: "Benutzer",
modal_tabheader2: "Namensfarbe",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Abzeichen",
modal_useravatar: "Benutzerbild",
modal_username: "Lokaler Benutzername",
modal_userolecolor: "Rollenfarbe nicht überschreiben",
2023-03-11 13:28:44 +01:00
modal_usertag: "Abzeichen",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Nicknamen nicht überschreiben",
submenu_resetsettings: "Benutzer zurücksetzen",
submenu_usersettings: "Einstellungen ändern"
2020-09-19 20:49:33 +02:00
};
case "el": // Greek
2020-09-19 20:49:33 +02:00
return {
2023-04-10 19:00:24 +02:00
confirm_reset: "Θέλετε την επαναφορά αυτού του χρήστη;",
confirm_resetall: "Θέλετε την επαναφορά όλων των χρηστών;",
context_localusersettings: "Ρυθμίσεις χρήστη (τοπικά)",
modal_colorpicker1: "Χρώμα ονόματος",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Χρώμα μηνύματος",
modal_colorpicker3: "Χρώμα ετικέτας",
modal_colorpicker4: "Χρώμα γραμματοσειράς",
2023-04-10 19:00:24 +02:00
modal_header: "Ρυθμίσεις χρήστη (τοπικά)",
modal_ignoretagcolor: "Χρήση του χρώματος του ρόλου",
2020-12-22 20:38:51 +01:00
modal_invalidurl: "Μη έγκυρη διεύθυνση URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Εμφάνιση ονόματος",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Εμφάνιση ψευδωνύμου",
modal_tabheader1: "Χρήστης",
modal_tabheader2: "Χρώμα ονόματος",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Ετικέτα",
2023-04-10 19:00:24 +02:00
modal_useravatar: "Εικόνα",
modal_username: "Όνομα χρήστη (τοπικά)",
modal_userolecolor: "Χωρίς αντικατάσταση του χρώματος του ρόλου",
2020-12-22 20:38:51 +01:00
modal_usertag: "Ετικέτα",
2023-04-10 19:00:24 +02:00
modal_useservernick: "Χωρίς αντικατάσταση των ψευδωνύμων",
submenu_resetsettings: "Επαναφορά χρήστη",
2023-04-10 19:00:24 +02:00
submenu_usersettings: "Αλλαγή ρυθμίσεις"
2020-09-19 20:49:33 +02:00
};
case "es": // Spanish
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "¿Está seguro de que desea restablecer este usuario?",
confirm_resetall: "¿Está seguro de que desea restablecer a todos los usuarios?",
context_localusersettings: "Configuración de usuario local",
modal_colorpicker1: "Color del nombre",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Color del mensaje",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Color de etiqueta",
modal_colorpicker4: "Color de fuente",
modal_header: "Configuración de usuario local",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Usar color de rol",
modal_invalidurl: "URL invalida",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Mostrar nombre",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Mostrar apodo",
modal_tabheader1: "Usuario",
modal_tabheader2: "Color del nombre",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Etiqueta",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Nombre de usuario local",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "No sobrescriba el color de la función",
modal_usertag: "Etiqueta",
2021-04-23 12:01:44 +02:00
modal_useservernick: "No sobrescriba los apodos",
submenu_resetsettings: "Restablecer usuario",
submenu_usersettings: "Cambiar ajustes"
2020-09-19 20:49:33 +02:00
};
case "fi": // Finnish
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Haluatko varmasti nollata tämän käyttäjän?",
confirm_resetall: "Haluatko varmasti nollata kaikki käyttäjät?",
context_localusersettings: "Paikalliset käyttäjäasetukset",
modal_colorpicker1: "Nimen väri",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Viestin väri",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Tagin väri",
modal_colorpicker4: "Fontin väri",
modal_header: "Paikalliset käyttäjäasetukset",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Käytä rooliväriä",
modal_invalidurl: "Virheellinen URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Näytä nimi",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Näytä lempinimi",
modal_tabheader1: "Käyttäjä",
modal_tabheader2: "Nimen väri",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Tag",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Hahmo",
modal_username: "Paikallinen käyttäjätunnus",
modal_userolecolor: "Älä korvaa roolin väriä",
modal_usertag: "Tag",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Älä korvaa lempinimiä",
submenu_resetsettings: "Nollaa käyttäjä",
submenu_usersettings: "Vaihda asetuksia"
2020-09-19 20:49:33 +02:00
};
case "fr": // French
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Êtes-vous sûr de vouloir réinitialiser cet utilisateur?",
confirm_resetall: "Voulez-vous vraiment réinitialiser tous les utilisateurs?",
context_localusersettings: "Paramètres locaux de l'utilisateur",
modal_colorpicker1: "Couleur du nom",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Couleur du message",
modal_colorpicker3: "Couleur de l'étiquette",
modal_colorpicker4: "Couleur de la police",
2020-12-22 20:38:51 +01:00
modal_header: "Paramètres locaux de l'utilisateur",
modal_ignoretagcolor: "Utiliser la couleur du rôle",
modal_invalidurl: "URL invalide",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Afficher le nom",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Afficher le surnom",
modal_tabheader1: "Utilisateur",
modal_tabheader2: "Couleur du nom",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Marque",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Nom local d'utilisateur",
modal_userolecolor: "Ne pas écraser la couleur du rôle",
modal_usertag: "Marque",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Ne pas écraser les surnoms",
submenu_resetsettings: "Réinitialiser l'utilisateur",
submenu_usersettings: "Modifier les paramètres"
2020-09-19 20:49:33 +02:00
};
2021-06-01 17:25:52 +02:00
case "hi": // Hindi
return {
confirm_reset: "क्या आप वाकई इस उपयोगकर्ता को रीसेट करना चाहते हैं?",
confirm_resetall: "क्या आप वाकई सभी उपयोगकर्ताओं को रीसेट करना चाहते हैं?",
context_localusersettings: "स्थानीय उपयोगकर्ता सेटिंग्स",
modal_colorpicker1: "नाम रंग",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "संदेश रंग",
2021-06-01 17:25:52 +02:00
modal_colorpicker3: "टैग रंग",
modal_colorpicker4: "लिपि का रंग",
modal_header: "स्थानीय उपयोगकर्ता सेटिंग्स",
modal_ignoretagcolor: "भूमिका रंग का प्रयोग करें",
modal_invalidurl: "असामान्य यूआरएल",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "नाम दिखाएं",
2021-06-01 17:25:52 +02:00
modal_showservernick: "उपनाम दिखाएं",
modal_tabheader1: "उपयोगकर्ता",
modal_tabheader2: "नाम रंग",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "टैग",
2021-06-01 17:25:52 +02:00
modal_useravatar: "अवतार",
modal_username: "स्थानीय उपयोगकर्ता नाम",
modal_userolecolor: "भूमिका रंग को अधिलेखित न करें",
modal_usertag: "टैग",
modal_useservernick: "उपनामों को अधिलेखित न करें",
submenu_resetsettings: "उपयोगकर्ता को रीसेट करें",
submenu_usersettings: "सेटिंग्स परिवर्तित करना"
};
case "hr": // Croatian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Jeste li sigurni da želite resetirati ovog korisnika?",
confirm_resetall: "Jeste li sigurni da želite resetirati sve korisnike?",
context_localusersettings: "Postavke lokalnog korisnika",
modal_colorpicker1: "Naziv Boja",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Boja poruke",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Oznaka u boji",
modal_colorpicker4: "Boja fonta",
2020-12-22 20:38:51 +01:00
modal_header: "Postavke lokalnog korisnika",
modal_ignoretagcolor: "Koristite boju uloga",
modal_invalidurl: "Neispravna poveznica",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Prikaži ime",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Prikaži nadimak",
modal_tabheader1: "Korisnik",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Naziv Boja",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Označiti",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Lokalno korisničko ime",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Nemojte prebrisati boju uloge",
modal_usertag: "Označiti",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Ne prepisujte nadimke",
submenu_resetsettings: "Resetiraj korisnika",
submenu_usersettings: "Promijeniti postavke"
2020-09-19 20:49:33 +02:00
};
case "hu": // Hungarian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Biztosan vissza akarja állítani ezt a felhasználót?",
confirm_resetall: "Biztosan vissza akarja állítani az összes felhasználót?",
context_localusersettings: "Helyi felhasználói beállítások",
modal_colorpicker1: "Név színe",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Üzenet színe",
modal_colorpicker3: "Címke színe",
modal_colorpicker4: "Betű szín",
modal_header: "Helyi felhasználói beállítások",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Használja a Szerepszínt",
modal_invalidurl: "Érvénytelen URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Név megjelenítése",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Becenév megjelenítése",
modal_tabheader1: "Felhasználó",
modal_tabheader2: "Név színe",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Címke",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Helyi felhasználónév",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Ne írja felül a Szerepszínt",
modal_usertag: "Címke",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Ne írja felül a beceneveket",
submenu_resetsettings: "Felhasználó visszaállítása",
submenu_usersettings: "Beállítások megváltoztatása"
2020-09-19 20:49:33 +02:00
};
case "it": // Italian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Sei sicuro di voler reimpostare questo utente?",
confirm_resetall: "Sei sicuro di voler reimpostare tutti gli utenti?",
context_localusersettings: "Impostazioni utente locale",
2022-04-21 18:31:14 +02:00
modal_colorpicker1: "Colore nome",
modal_colorpicker2: "Colore messaggio",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Colore tag",
modal_colorpicker4: "Colore del carattere",
modal_header: "Impostazioni utente locale",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Usa colore ruolo",
modal_invalidurl: "URL non valido",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Mostra nome",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Mostra soprannome",
modal_tabheader1: "Utente",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Nome Colore",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Etichetta",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Nome utente locale",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Non sovrascrivere il colore del ruolo",
modal_usertag: "Etichetta",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Non sovrascrivere i soprannomi",
submenu_resetsettings: "Reimposta utente",
submenu_usersettings: "Cambia impostazioni"
2020-09-19 20:49:33 +02:00
};
case "ja": // Japanese
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "このユーザーをリセットしてもよろしいですか?",
confirm_resetall: "すべてのユーザーをリセットしてもよろしいですか?",
context_localusersettings: "ローカルユーザー設定",
modal_colorpicker1: "名前の色",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "メッセージの色",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "タグの色",
modal_colorpicker4: "フォントの色",
modal_header: "ローカルユーザー設定",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "役割の色を使用する",
modal_invalidurl: "無効なURL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "名前を表示",
2021-06-01 17:25:52 +02:00
modal_showservernick: "ニックネームを表示",
modal_tabheader1: "ユーザー",
modal_tabheader2: "名前の色",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "鬼ごっこ",
2020-12-22 20:38:51 +01:00
modal_useravatar: "アバター",
modal_username: "ローカルユーザー名",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "役割の色を上書きしないでください",
modal_usertag: "鬼ごっこ",
2021-04-23 12:01:44 +02:00
modal_useservernick: "ニックネームを上書きしないでください",
2020-12-22 20:38:51 +01:00
submenu_resetsettings: "ユーザーのリセット",
submenu_usersettings: "設定を変更する"
2020-09-19 20:49:33 +02:00
};
case "ko": // Korean
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "이 사용자를 재설정 하시겠습니까?",
confirm_resetall: "모든 사용자를 재설정 하시겠습니까?",
context_localusersettings: "로컬 사용자 설정",
modal_colorpicker1: "이름 색상",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "메시지 색상",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "태그 색상",
modal_colorpicker4: "글자 색",
modal_header: "로컬 사용자 설정",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "역할 색상 사용",
modal_invalidurl: "잘못된 URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "이름 표시",
2021-06-01 17:25:52 +02:00
modal_showservernick: "닉네임 표시",
modal_tabheader1: "사용자",
modal_tabheader2: "이름 색상",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "꼬리표",
2020-12-22 20:38:51 +01:00
modal_useravatar: "화신",
modal_username: "로컬 사용자 이름",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "역할 색상을 덮어 쓰지 마십시오.",
modal_usertag: "꼬리표",
2021-04-23 12:01:44 +02:00
modal_useservernick: "별명을 덮어 쓰지 마십시오",
submenu_resetsettings: "사용자 재설정",
submenu_usersettings: "설정 변경"
2020-09-19 20:49:33 +02:00
};
case "lt": // Lithuanian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Ar tikrai norite iš naujo nustatyti šį naudotoją?",
confirm_resetall: "Ar tikrai norite iš naujo nustatyti visus naudotojus?",
context_localusersettings: "Vietinio vartotojo nustatymai",
modal_colorpicker1: "Pavadinimo spalva",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Pranešimo spalva",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Žymos spalva",
modal_colorpicker4: "Šrifto spalva",
modal_header: "Vietinio vartotojo nustatymai",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Naudokite vaidmens spalvą",
modal_invalidurl: "Neteisingas URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Rodyti pavadinimą",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Rodyti slapyvardį",
modal_tabheader1: "Vartotojas",
modal_tabheader2: "Pavadinimo spalva",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Žyma",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avataras",
modal_username: "Vietinis vartotojo vardas",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Neperrašykite vaidmens spalvos",
modal_usertag: "Žyma",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Neperrašykite slapyvardžių",
submenu_resetsettings: "Iš naujo nustatyti vartotoją",
submenu_usersettings: "Pakeisti nustatymus"
2020-09-19 20:49:33 +02:00
};
case "nl": // Dutch
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Weet u zeker dat u deze gebruiker wilt resetten?",
confirm_resetall: "Weet u zeker dat u alle gebruikers wilt resetten?",
context_localusersettings: "Lokale gebruikersinstellingen",
modal_colorpicker1: "Naamkleur",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Berichtkleur",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Tagkleur",
modal_colorpicker4: "Letterkleur",
modal_header: "Lokale gebruikersinstellingen",
modal_ignoretagcolor: "Gebruik rolkleur",
modal_invalidurl: "Ongeldige URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Toon naam",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Bijnaam weergeven",
modal_tabheader1: "Gebruiker",
modal_tabheader2: "Naamkleur",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Label",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Lokale gebruikersnaam",
modal_userolecolor: "Overschrijf de rolkleur niet",
2020-12-22 20:38:51 +01:00
modal_usertag: "Label",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Overschrijf geen bijnamen",
2020-12-22 20:38:51 +01:00
submenu_resetsettings: "Gebruiker resetten",
submenu_usersettings: "Instellingen veranderen"
2020-09-19 20:49:33 +02:00
};
case "no": // Norwegian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Er du sikker på at du vil tilbakestille denne brukeren?",
confirm_resetall: "Er du sikker på at du vil tilbakestille alle brukere?",
context_localusersettings: "Lokale brukerinnstillinger",
2020-12-22 20:38:51 +01:00
modal_colorpicker1: "Navnfarge",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Meldingfarge",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Merkefarge",
modal_colorpicker4: "Skriftfarge",
modal_header: "Lokale brukerinnstillinger",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Bruk rollefarge",
modal_invalidurl: "Ugyldig URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Vis navn",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Vis kallenavn",
modal_tabheader1: "Bruker",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Navnfarge",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Stikkord",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Lokalt brukernavn",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Ikke skriv rollefargen",
modal_usertag: "Stikkord",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Ikke overskriv kallenavn",
submenu_resetsettings: "Tilbakestill bruker",
submenu_usersettings: "Endre innstillinger"
2020-09-19 20:49:33 +02:00
};
case "pl": // Polish
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Czy na pewno chcesz zresetować tego użytkownika?",
confirm_resetall: "Czy na pewno chcesz zresetować wszystkich użytkowników?",
context_localusersettings: "Ustawienia użytkownika lokalnego",
modal_colorpicker1: "Nazwa Kolor",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Kolor wiadomości",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Kolor tagu",
modal_colorpicker4: "Kolor czcionki",
2020-12-22 20:38:51 +01:00
modal_header: "Ustawienia użytkownika lokalnego",
modal_ignoretagcolor: "Użyj koloru roli",
modal_invalidurl: "Nieprawidłowy URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Pokaż nazwę",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Pokaż pseudonim",
modal_tabheader1: "Użytkownik",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Nazwa Kolor",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Etykietka",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Awatara",
modal_username: "Lokalna nazwa użytkownika",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Nie zastępuj koloru roli",
modal_usertag: "Etykietka",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Nie nadpisuj pseudonimów",
2020-12-22 20:38:51 +01:00
submenu_resetsettings: "Resetuj użytkownika",
submenu_usersettings: "Zmień ustawienia"
2020-09-19 20:49:33 +02:00
};
case "pt-BR": // Portuguese (Brazil)
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Tem certeza de que deseja redefinir este usuário?",
confirm_resetall: "Tem certeza de que deseja redefinir todos os usuários?",
context_localusersettings: "Configurações de usuário local",
modal_colorpicker1: "Cor do nome",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Cor da Mensagem",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Cor da tag",
modal_colorpicker4: "Cor da fonte",
modal_header: "Configurações de usuário local",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Use a cor da função",
modal_invalidurl: "URL inválida",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Mostrar nome",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Mostrar apelido",
modal_tabheader1: "Do utilizador",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Cor do Nome",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Tag",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Nome de usuário local",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Não sobrescreva a Cor da Função",
modal_usertag: "Tag",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Não sobrescrever apelidos",
submenu_resetsettings: "Reiniciar usuário",
submenu_usersettings: "Mudar configurações"
2020-09-19 20:49:33 +02:00
};
case "ro": // Romanian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Sigur doriți să resetați acest utilizator?",
confirm_resetall: "Sigur doriți să resetați toți utilizatorii?",
context_localusersettings: "Setări locale ale utilizatorului",
2020-12-22 20:38:51 +01:00
modal_colorpicker1: "Culoare nume",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Culoarea mesajului",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Culoare etichetă",
modal_colorpicker4: "Culoarea fontului",
modal_header: "Setări locale ale utilizatorului",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Utilizați culoarea rolului",
modal_invalidurl: "URL invalid",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Afișează numele",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Afișează porecla",
modal_tabheader1: "Utilizator",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Culoare nume",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Etichetă",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Nume utilizator local",
modal_userolecolor: "Nu suprascrieți culoarea rolului",
modal_usertag: "Etichetă",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Nu suprascrieți porecle",
submenu_resetsettings: "Resetați utilizatorul",
submenu_usersettings: "Schimbă setările"
2020-09-19 20:49:33 +02:00
};
case "ru": // Russian
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Вы уверены, что хотите сбросить этого пользователя?",
confirm_resetall: "Вы уверены, что хотите сбросить всех пользователей?",
context_localusersettings: "Настройки локального пользователя",
modal_colorpicker1: "Цвет имени",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Цвет сообщения",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Цвет метки",
modal_colorpicker4: "Цвет шрифта",
modal_header: "Настройки локального пользователя",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Использовать цвет роли",
modal_invalidurl: "Неверная ссылка",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Показать имя",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Показать ник",
modal_tabheader1: "Пользователь",
modal_tabheader2: "Цвет имени",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Тег",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Аватар",
modal_username: "Локальное имя пользователя",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Не перезаписывайте цвет роли",
modal_usertag: "Тег",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Не перезаписывать никнеймы",
submenu_resetsettings: "Сбросить пользователя",
submenu_usersettings: "Изменить настройки"
2020-09-19 20:49:33 +02:00
};
case "sv": // Swedish
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Är du säker på att du vill återställa den här användaren?",
confirm_resetall: "Är du säker på att du vill återställa alla användare?",
context_localusersettings: "Lokala användarinställningar",
modal_colorpicker1: "Namnfärg",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Meddelandefärg",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Taggfärg",
modal_colorpicker4: "Fontfärg",
modal_header: "Lokala användarinställningar",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Använd rollfärg",
modal_invalidurl: "Ogiltig URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Visa namn",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Visa smeknamn",
modal_tabheader1: "Användare",
modal_tabheader2: "Namnfärg",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Märka",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Lokalt användarnamn",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Skriv inte över rollfärgen",
modal_usertag: "Märka",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Skriv inte över smeknamn",
submenu_resetsettings: "Återställ användare",
submenu_usersettings: "Ändra inställningar"
2020-09-19 20:49:33 +02:00
};
case "th": // Thai
2020-09-19 20:49:33 +02:00
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "แน่ใจไหมว่าต้องการรีเซ็ตผู้ใช้นี้",
confirm_resetall: "แน่ใจไหมว่าต้องการรีเซ็ตผู้ใช้ทั้งหมด",
context_localusersettings: "การตั้งค่าผู้ใช้ภายใน",
modal_colorpicker1: "ชื่อสี",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "สีข้อความ",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "สีแท็ก",
modal_colorpicker4: "สีตัวอักษร",
modal_header: "การตั้งค่าผู้ใช้ภายใน",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "ใช้สีของบทบาท",
modal_invalidurl: "URL ไม่ถูกต้อง",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "แสดงชื่อ",
2021-06-01 17:25:52 +02:00
modal_showservernick: "แสดงชื่อเล่น",
modal_tabheader1: "ผู้ใช้",
modal_tabheader2: "ชื่อสี",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "แท็ก",
2020-12-22 20:38:51 +01:00
modal_useravatar: "สัญลักษณ์",
modal_username: "ชื่อผู้ใช้ท้องถิ่น",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "อย่าเขียนทับสีของบทบาท",
modal_usertag: "แท็ก",
2021-04-23 12:01:44 +02:00
modal_useservernick: "อย่าเขียนทับชื่อเล่น",
submenu_resetsettings: "รีเซ็ตผู้ใช้",
submenu_usersettings: "เปลี่ยนการตั้งค่า"
};
case "tr": // Turkish
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Bu Kullanıcıyı sıfırlamak istediğinizden emin misiniz?",
confirm_resetall: "Tüm Kullanıcıları sıfırlamak istediğinizden emin misiniz?",
context_localusersettings: "Yerel Kullanıcı Ayarları",
modal_colorpicker1: "İsim Rengi",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Mesaj Rengi",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Etiket Rengi",
modal_colorpicker4: "Yazı rengi",
2020-12-22 20:38:51 +01:00
modal_header: "Yerel Kullanıcı Ayarları",
modal_ignoretagcolor: "Rol Rengini Kullan",
modal_invalidurl: "Geçersiz URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "İsim göster",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Takma adı göster",
modal_tabheader1: "Kullanıcı",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "İsim Rengi",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Etiket",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Avatar",
modal_username: "Yerel Kullanıcı Adı",
modal_userolecolor: "Rol Renginin üzerine yazmayın",
modal_usertag: "Etiket",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Takma adların üzerine yazmayın",
2020-12-22 20:38:51 +01:00
submenu_resetsettings: "Kullanıcıyı Sıfırla",
submenu_usersettings: "Ayarları değiştir"
};
case "uk": // Ukrainian
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Ви впевнені, що хочете скинути налаштування цього користувача?",
confirm_resetall: "Ви впевнені, що хочете скинути налаштування всіх користувачів?",
context_localusersettings: "Налаштування локального користувача",
2020-12-22 20:38:51 +01:00
modal_colorpicker1: "Назва Колір",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Колір повідомлення",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Колір тегу",
modal_colorpicker4: "Колір шрифту",
modal_header: "Налаштування локального користувача",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Використовуйте колір ролі",
modal_invalidurl: "Недійсна URL-адреса",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Показати ім'я",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Показати псевдонім",
modal_tabheader1: "Користувач",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Назва Колір",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Позначка",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Аватар",
modal_username: "Локальне ім’я користувача",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Не перезаписуйте колір ролі",
modal_usertag: "Позначка",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Не перезаписуйте псевдоніми",
submenu_resetsettings: "Скинути налаштування користувача",
submenu_usersettings: "Змінити налаштування"
};
case "vi": // Vietnamese
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Bạn có chắc chắn muốn đặt lại Người dùng này không?",
confirm_resetall: "Bạn có chắc chắn muốn đặt lại tất cả Người dùng không?",
context_localusersettings: "Cài đặt người dùng cục bộ",
2020-12-22 20:38:51 +01:00
modal_colorpicker1: "Tên màu",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Màu tin nhắn",
2020-12-22 20:38:51 +01:00
modal_colorpicker3: "Màu thẻ",
modal_colorpicker4: "Màu phông chữ",
modal_header: "Cài đặt người dùng cục bộ",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "Sử dụng màu vai trò",
modal_invalidurl: "URL không hợp lệ",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Hiện tên",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Hiển thị biệt hiệu",
modal_tabheader1: "Người dùng",
2020-12-22 20:38:51 +01:00
modal_tabheader2: "Tên màu",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Nhãn",
2020-12-22 20:38:51 +01:00
modal_useravatar: "Hình đại diện",
modal_username: "Tên người dùng cục bộ",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "Không ghi đè Màu vai trò",
modal_usertag: "Nhãn",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Không ghi đè biệt hiệu",
submenu_resetsettings: "Đặt lại người dùng",
submenu_usersettings: "Thay đổi cài đặt"
};
2021-01-15 17:54:22 +01:00
case "zh-CN": // Chinese (China)
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "您确定要重置此用户吗?",
confirm_resetall: "您确定要重置所有用户吗?",
context_localusersettings: "本地用户设置",
modal_colorpicker1: "名称颜色",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "讯息颜色",
modal_colorpicker3: "标签颜色",
modal_colorpicker4: "字体颜色",
modal_header: "本地用户设置",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "使用角色颜色",
modal_invalidurl: "无效的网址",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "显示名称",
2021-06-01 17:25:52 +02:00
modal_showservernick: "显示昵称",
modal_tabheader1: "用户",
modal_tabheader2: "名称颜色",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "标签",
2020-12-22 20:38:51 +01:00
modal_useravatar: "头像",
modal_username: "本地用户名",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "不要覆盖角色颜色",
modal_usertag: "标签",
2021-04-23 12:01:44 +02:00
modal_useservernick: "不要覆盖昵称",
submenu_resetsettings: "重置用户",
submenu_usersettings: "更改设置"
};
2021-01-15 17:54:22 +01:00
case "zh-TW": // Chinese (Taiwan)
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "您確定要重置此用戶嗎?",
confirm_resetall: "您確定要重置所有用戶嗎?",
context_localusersettings: "本地用戶設置",
modal_colorpicker1: "名稱顏色",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "訊息顏色",
modal_colorpicker3: "標籤顏色",
modal_colorpicker4: "字體顏色",
modal_header: "本地用戶設置",
2020-12-22 20:38:51 +01:00
modal_ignoretagcolor: "使用角色顏色",
modal_invalidurl: "無效的網址",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "顯示名稱",
2021-06-01 17:25:52 +02:00
modal_showservernick: "顯示暱稱",
modal_tabheader1: "用戶",
modal_tabheader2: "名稱顏色",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "標籤",
2020-12-22 20:38:51 +01:00
modal_useravatar: "頭像",
modal_username: "本地用戶名",
2020-12-22 20:38:51 +01:00
modal_userolecolor: "不要覆蓋角色顏色",
modal_usertag: "標籤",
2021-04-23 12:01:44 +02:00
modal_useservernick: "不要覆蓋暱稱",
submenu_resetsettings: "重置用戶",
submenu_usersettings: "更改設置"
};
default: // English
return {
2020-12-22 20:38:51 +01:00
confirm_reset: "Are you sure you want to reset this User?",
confirm_resetall: "Are you sure you want to reset all Users?",
context_localusersettings: "Local User Settings",
modal_colorpicker1: "Name Color",
2022-04-21 18:31:14 +02:00
modal_colorpicker2: "Message Color",
modal_colorpicker3: "Tag Color",
modal_colorpicker4: "Font Color",
modal_header: "Local User Settings",
modal_ignoretagcolor: "Use Role Color",
modal_invalidurl: "Invalid URL",
2021-11-03 15:57:22 +01:00
modal_showaccountname: "Show Name",
2021-06-01 17:25:52 +02:00
modal_showservernick: "Show Nickname",
modal_tabheader1: "User",
modal_tabheader2: "Name Color",
2023-03-11 13:28:44 +01:00
modal_tabheader3: "Tag",
modal_useravatar: "Avatar",
modal_username: "Local Username",
modal_userolecolor: "Do not overwrite the Role Color",
modal_usertag: "Tag",
2021-04-23 12:01:44 +02:00
modal_useservernick: "Do not overwrite Nicknames",
submenu_resetsettings: "Reset User",
submenu_usersettings: "Change Settings"
2020-09-19 20:49:33 +02:00
};
}
}
};
2022-09-01 14:40:11 +02:00
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
2023-06-21 11:34:51 +02:00
})();