stuff
This commit is contained in:
parent
f3366594bb
commit
dcff64e2e6
|
@ -400,6 +400,13 @@
|
|||
"NowPlayingItem": {"strings": [".wrapper", "padded:"]},
|
||||
"PanelButton": {"strings": ["Masks.PANEL_BUTTON"]},
|
||||
"ParticipantsForSelectedParticipant": {"strings": ["ACTIVITY", "maxVisibleUsers", "participantType"]},
|
||||
"PeopleList": {"strings": [".SECTION_NO_RESULTS", ".section", "SUGGESTIONS"]},
|
||||
"PeopleListItem": {"strings": ["height:new", "isFocused", "onOtherHover"]},
|
||||
"PeopleListItemBlocked": {"strings": [".listItemContents", "UNKNOWN", ".BLOCKED"]},
|
||||
"PeopleListItemFriend": {"strings": [".getMutablePrivateChannels", ".handleOpenPrivateChannel", "isActiveRow"]},
|
||||
"PeopleListItemPending": {"strings": ["PENDING_INCOMING", ".DENY", "addRelationship"]},
|
||||
"PeopleListSectionedLazy": {"strings": [".statusSections", ".peopleList", "id:\"people-list\""]},
|
||||
"PeopleListSectionedNonLazy": {"strings": [".statusSections", ".peopleList", "id:\"people\""]},
|
||||
"PrivateChannel": {"strings": ["LEAVE_GROUP_DM_MANAGED_BODY", "handleCloseButtonMouseDown", "handleLeaveGroup"]},
|
||||
"PrivateChannelRecipients": {"strings": [".membersWrap", "recipients"]},
|
||||
"PrivateChannelsList": {"strings": ["privateChannelIds", "privateChannelRecipientsInviteButtonIcon"]},
|
||||
|
@ -419,6 +426,7 @@
|
|||
"Spoiler": {"strings": ["revealSpoiler", ".onReveal"]},
|
||||
"SpoilerWarning": {"strings": [".spoilerWarning", ".SPOILER"]},
|
||||
"StandardSidebarView": {"strings": ["standardSidebarView", ".sidebarTheme", "mobileSidebarHeader"]},
|
||||
"TabBar": {"props": ["Types", "Looks", "Item", "Panel"]},
|
||||
"TransitionGroup": {"protos": ["performAppear", "performEnter", "performLeave"]},
|
||||
"UnreadDMs": {"strings": ["getMutablePrivateChannels", "selectedVoiceGuildId", ".selectedVoiceChannelId"]},
|
||||
"UseCopyIdItem": {"strings": ["\"devmode-copy-id\""]},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @name BetterFriendList
|
||||
* @author DevilBro
|
||||
* @authorId 278543574059057154
|
||||
* @version 1.4.6
|
||||
* @version 1.4.7
|
||||
* @description Adds extra Controls to the Friends Page, for example sort by Name/Status, Search and All/Request/Blocked Amount
|
||||
* @invite Jx3TjNS
|
||||
* @donate https://www.paypal.me/MircoWittrien
|
||||
|
@ -87,22 +87,28 @@ module.exports = (_ => {
|
|||
}
|
||||
};
|
||||
|
||||
this.patchedModules = {
|
||||
before: {
|
||||
TabBar: "render",
|
||||
PeopleListSectionedLazy: "default",
|
||||
PeopleListSectionedNonLazy: "default"
|
||||
},
|
||||
after: {
|
||||
TabBar: "render",
|
||||
PeopleListSectionedLazy: "default",
|
||||
PeopleListSectionedNonLazy: "default",
|
||||
PeopleList: "default",
|
||||
FriendRow: "render",
|
||||
PendingRow: "default",
|
||||
BlockedRow: "render",
|
||||
PeopleListItem: ["render", "componentDidMount","componentWillUnmount"]
|
||||
}
|
||||
this.modulePatches = {
|
||||
before: [
|
||||
"PeopleListSectionedLazy",
|
||||
"PeopleListSectionedNonLazy",
|
||||
"TabBar"
|
||||
],
|
||||
after: [
|
||||
"PeopleList",
|
||||
"PeopleListItem",
|
||||
"PeopleListItemBlocked",
|
||||
"PeopleListItemFriend",
|
||||
"PeopleListItemPending",
|
||||
"PeopleListSectionedLazy",
|
||||
"PeopleListSectionedNonLazy",
|
||||
"TabBar"
|
||||
],
|
||||
componentDidMount: [
|
||||
"PeopleListItem"
|
||||
],
|
||||
componentWillUnmount: [
|
||||
"PeopleListItem"
|
||||
]
|
||||
};
|
||||
|
||||
this.css = `
|
||||
|
@ -180,10 +186,11 @@ module.exports = (_ => {
|
|||
}
|
||||
|
||||
onUserContextMenu (e) {
|
||||
if (e.instance.props.user && e.subType == "useUserRelationshipItems" && BDFDB.LibraryStores.RelationshipStore.isFriend(e.instance.props.user.id)) {
|
||||
if (!e.instance.props.user || !BDFDB.LibraryStores.RelationshipStore.isFriend(e.instance.props.user.id)) return;
|
||||
let favorized = favorizedFriends.indexOf(e.instance.props.user.id) > -1;
|
||||
let hidden = hiddenFriends.indexOf(e.instance.props.user.id) > -1;
|
||||
e.returnvalue.push(this.settings.general.addFavorizedCategory && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "remove-friend"});
|
||||
if (index > -1) children.splice(index + 1, 0, this.settings.general.addFavorizedCategory && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||
label: favorized ? this.labels.context_unfavorizefriend : this.labels.context_favorizefriend,
|
||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, favorized ? "unfavorize-friend" : "favorize-friend"),
|
||||
action: _ => {
|
||||
|
@ -211,7 +218,6 @@ module.exports = (_ => {
|
|||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
processTabBar (e) {
|
||||
if (e.instance.props.children && e.instance.props.children.some(c => c && c.props.id == BDFDB.DiscordConstants.FriendsSections.ADD_FRIEND)) {
|
||||
|
@ -315,8 +321,8 @@ module.exports = (_ => {
|
|||
}
|
||||
|
||||
processPeopleList (e) {
|
||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "SectionTitle"});
|
||||
if (index > -1) {
|
||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: n => n && n.props && n.props.title && n.props.id});
|
||||
if (index == -1) return;
|
||||
let users = (BDFDB.ReactUtils.findChild(e.returnvalue, {props: ["statusSections"]}) || {props: {statusSections: []}}).props.statusSections.flat(10);
|
||||
let filteredUsers = users;
|
||||
if (this.settings.general.addFavorizedCategory) {
|
||||
|
@ -366,18 +372,17 @@ module.exports = (_ => {
|
|||
].flat(10).filter(n => n)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
processFriendRow (e) {
|
||||
processPeopleListItemFriend (e) {
|
||||
e.returnvalue.props.mutualGuilds = e.instance.props.mutualGuilds;
|
||||
}
|
||||
|
||||
processPendingRow (e) {
|
||||
this.processFriendRow(e);
|
||||
processPeopleListItemPending (e) {
|
||||
this.processPeopleListItemFriend(e);
|
||||
}
|
||||
|
||||
processBlockedRow (e) {
|
||||
this.processFriendRow(e);
|
||||
processPeopleListItemBlocked (e) {
|
||||
this.processPeopleListItemFriend(e);
|
||||
}
|
||||
|
||||
processPeopleListItem (e) {
|
||||
|
@ -402,7 +407,7 @@ module.exports = (_ => {
|
|||
}
|
||||
|
||||
injectMutualGuilds (returnvalue, mutualGuilds) {
|
||||
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {name: "UserInfo"});
|
||||
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {filter: n => n && n.props && n.props.subText && n.props.user});
|
||||
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildSummaryItem, {
|
||||
className: BDFDB.disCN._betterfriendlistmutualguilds,
|
||||
guilds: mutualGuilds,
|
||||
|
|
Loading…
Reference in New Issue