This commit is contained in:
Mirco Wittrien 2022-06-23 19:28:44 +02:00
parent 435046fcfc
commit 978d396ebb
2 changed files with 13 additions and 10 deletions

View File

@ -242,6 +242,7 @@
"DirectMessage": {"class": "guildouter", "forceObserve": true},
"EmojiPicker": {"strings": ["EMOJI_PICKER_TAB_PANEL_ID", "diversitySelector"]},
"FocusRing": {"props": ["FocusRingScope"]},
"GuildFavorites": {"strings": [".favoriteIcon", "FAVORITES_GUILD_NAME"]},
"GuildFolderSettingsModal": {"lazyLoaded": true, "exported": true},
"GuildHeader": {"strings": ["bannerVisible", "guildBanner", "onContextMenu"]},
"GuildIcon": {"class": "avataricon", "forceObserve": true},
@ -362,6 +363,7 @@
"Badge": {"name": "GuildBadge"},
"BlobMask": {"name": "BlobMask"},
"DragPlaceholder": {"name": "DragPlaceholder"},
"Favorites": {"strings": [".favoriteIcon", "FAVORITES_GUILD_NAME"]},
"Icon": {"name": "GuildIconWrapper"},
"MutedText": {"props": ["useMutedUntilText"], "value": "default"},
"Pill": {"strings": ["opacity:1,height:", "20:8", "default.item"]},
@ -2738,7 +2740,6 @@
"noticedefault": ["Notice", "colorDefault"],
"noticedownload": ["Notice", "colorDownload"],
"noticedismiss": ["Notice", "closeButton"],
"noticedismissicon": ["Notice", "closeIcon"],
"noticeicon": ["NoticePlatform", "icon"],
"noticeiconandroid": ["NoticePlatform", "iconAndroid"],
"noticeiconapple": ["NoticePlatform", "iconApple"],

View File

@ -2,7 +2,7 @@
* @name DisplayServersAsChannels
* @author DevilBro
* @authorId 278543574059057154
* @version 1.5.8
* @version 1.5.9
* @description Displays Servers in a similar way as Channels
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,15 +17,8 @@ module.exports = (_ => {
"info": {
"name": "DisplayServersAsChannels",
"author": "DevilBro",
"version": "1.5.8",
"version": "1.5.9",
"description": "Displays Servers in a similar way as Channels"
},
"changeLog": {
"improved": {
"Voice/Stream Users": "Shows Voice/Stream Users Tooltip when hovering over a Server",
"Muted": "Reduces Opacity of DM/Server Name if they are muted",
"New Inbox Position": "Works for the new Inbox Position above the Home Button"
}
}
};
@ -85,6 +78,7 @@ module.exports = (_ => {
after: {
Guilds: "type",
HomeButton: "type",
GuildFavorites: "default",
DirectMessage: "render",
GuildItem: "type",
FolderItem: "default",
@ -161,6 +155,8 @@ module.exports = (_ => {
}
processGuilds (e) {
let [favoritesChildren, favoritesIndex] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: n => n && n.type && [".favoriteIcon", "FAVORITES_GUILD_NAME"].every(s => n.type.toString().indexOf(s) > -1)});
if (favoritesIndex > -1) favoritesChildren[favoritesIndex] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Favorites, {});
let [errorChildren, errorIndex] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FluxContainer(<Unknown>)"});
if (errorIndex > -1) errorChildren[errorIndex] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.UnavailableGuildsButton, {
unavailableGuilds: BDFDB.LibraryModules.GuildUnavailableStore.totalUnavailableGuilds
@ -178,6 +174,12 @@ module.exports = (_ => {
this.addElementName(e.returnvalue, BDFDB.LanguageUtils.LanguageStrings.HOME);
}
processGuildFavorites (e) {
this.removeTooltip(e.returnvalue);
e.returnvalue = this.removeMask(e.returnvalue);
this.addElementName(e.returnvalue, BDFDB.LanguageUtils.LanguageStrings.FAVORITES_GUILD_NAME);
}
processDirectMessage (e) {
if (e.instance.props.channel.id) {
if (e.returnvalue.props.children && e.returnvalue.props.children.props) e.returnvalue.props.children.props.className = BDFDB.DOMUtils.formatClassName(e.returnvalue.props.children.props.className, BDFDB.LibraryModules.MutedUtils.isChannelMuted(null, e.instance.props.channel.id) && BDFDB.disCN._displayserversaschannelsmuted);