stuff
This commit is contained in:
parent
ba58d12f6d
commit
23b535e67f
|
@ -2,7 +2,7 @@
|
||||||
* @name RemoveBlockedUsers
|
* @name RemoveBlockedUsers
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.5.1
|
* @version 1.5.2
|
||||||
* @description Removes blocked Messages/Users
|
* @description Removes blocked Messages/Users
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -17,7 +17,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "RemoveBlockedUsers",
|
"name": "RemoveBlockedUsers",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"description": "Removes blocked Messages/Users"
|
"description": "Removes blocked Messages/Users"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -409,31 +409,26 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
for (let i in newRows) if (newRows[i] && newRows[i].type == "GROUP" && newRows[i].count <= 0) newRows[i] = undefined;
|
for (let i in newRows) if (newRows[i] && newRows[i].type == "GROUP" && newRows[i].count <= 0) newRows[i] = undefined;
|
||||||
const removeEmptyWithin = (array, filter) => {
|
const removeEmptyWithin = (array, filter) => {
|
||||||
let reversed = [].concat(array).reverse();
|
let reversed = [].concat(array).reverse(), suffixLength = 0;
|
||||||
let prefixLength = 0, suffixLength = 0;
|
|
||||||
for (let i in array) if (array[i] !== undefined) {
|
|
||||||
prefixLength = parseInt(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for (let i in reversed) if (reversed[i] !== undefined) {
|
for (let i in reversed) if (reversed[i] !== undefined) {
|
||||||
suffixLength = parseInt(i);
|
suffixLength = parseInt(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return [].concat(new Array(prefixLength), array.filter(filter), new Array(suffixLength))
|
return [].concat(array.filter(filter), new Array(suffixLength))
|
||||||
};
|
};
|
||||||
channelMembers.props.rows = removeEmptyWithin(newRows, n => n);
|
channelMembers.props.rows = removeEmptyWithin(newRows, n => n);
|
||||||
channelMembers.props.groups = removeEmptyWithin(newGroups, g => g && g.count > 0);
|
channelMembers.props.groups = removeEmptyWithin(newGroups, g => g && g.count > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processPrivateChannelRecipients (e) {
|
|
||||||
if (this.settings.places.voiceChat && e.instance.props.channel && e.instance.props.channel.isGroupDM()) e.instance.props.channel = new BDFDB.DiscordObjects.Channel(Object.assign({}, e.instance.props.channel, {rawRecipients: e.instance.props.channel.rawRecipients.filter(n => !n || !BDFDB.LibraryModules.RelationshipStore.isBlocked(n.id)), recipients: e.instance.props.channel.recipients.filter(id => !id || !BDFDB.LibraryModules.RelationshipStore.isBlocked(id))}));
|
|
||||||
}
|
|
||||||
|
|
||||||
processMemberListItem (e) {
|
processMemberListItem (e) {
|
||||||
if (this.settings.places.memberList && e.instance.props.user && BDFDB.LibraryModules.RelationshipStore.isBlocked(e.instance.props.user.id)) return null;
|
if (this.settings.places.memberList && e.instance.props.user && BDFDB.LibraryModules.RelationshipStore.isBlocked(e.instance.props.user.id)) return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processPrivateChannelRecipients (e) {
|
||||||
|
if (this.settings.places.voiceChat && e.instance.props.channel && e.instance.props.channel.isGroupDM()) e.instance.props.channel = new BDFDB.DiscordObjects.Channel(Object.assign({}, e.instance.props.channel, {rawRecipients: e.instance.props.channel.rawRecipients.filter(n => !n || !BDFDB.LibraryModules.RelationshipStore.isBlocked(n.id)), recipients: e.instance.props.channel.recipients.filter(id => !id || !BDFDB.LibraryModules.RelationshipStore.isBlocked(id))}));
|
||||||
|
}
|
||||||
|
|
||||||
processNowPlayingItem (e) {
|
processNowPlayingItem (e) {
|
||||||
if (this.settings.places.activity) {
|
if (this.settings.places.activity) {
|
||||||
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {name: "NowPlayingHeader"});
|
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {name: "NowPlayingHeader"});
|
||||||
|
|
|
@ -698,7 +698,7 @@ module.exports = (_ => {
|
||||||
let ids = BDFDB.LibraryModules.FolderStore.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10);
|
let ids = BDFDB.LibraryModules.FolderStore.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10);
|
||||||
args[2] = args[2].filter(id => !ids.includes(id));
|
args[2] = args[2].filter(id => !ids.includes(id));
|
||||||
return topIsVisible(...args) || BDFDB.LibraryModules.UnreadGuildUtils.getMentionCount(args[0]) == 0;
|
return topIsVisible(...args) || BDFDB.LibraryModules.UnreadGuildUtils.getMentionCount(args[0]) == 0;
|
||||||
}, "Error in isVisible of Top Bar in Guild List!");
|
}, "Error in isVisible of Top Bar in Guild List!", this);
|
||||||
}
|
}
|
||||||
let bottomBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.guildswrapperunreadmentionsbarbottom]]});
|
let bottomBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.guildswrapperunreadmentionsbarbottom]]});
|
||||||
if (bottomBar) {
|
if (bottomBar) {
|
||||||
|
@ -707,7 +707,7 @@ module.exports = (_ => {
|
||||||
let ids = BDFDB.LibraryModules.FolderStore.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10);
|
let ids = BDFDB.LibraryModules.FolderStore.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10);
|
||||||
args[2] = args[2].filter(id => !ids.includes(id));
|
args[2] = args[2].filter(id => !ids.includes(id));
|
||||||
return bottomIsVisible(...args) || BDFDB.LibraryModules.UnreadGuildUtils.getMentionCount(args[0]) == 0;
|
return bottomIsVisible(...args) || BDFDB.LibraryModules.UnreadGuildUtils.getMentionCount(args[0]) == 0;
|
||||||
}, "Error in isVisible of Bottom Bar in Guild List!");
|
}, "Error in isVisible of Bottom Bar in Guild List!", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue