Update RemoveBlockedUsers.plugin.js

This commit is contained in:
Mirco Wittrien 2024-12-09 20:19:10 +01:00
parent 6aa34898a0
commit 09a144149f
1 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
* @name RemoveBlockedUsers * @name RemoveBlockedUsers
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.6.9 * @version 1.7.0
* @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
@ -77,6 +77,8 @@ module.exports = (_ => {
}, },
places: { places: {
messages: {value: true, description: "Messages"}, messages: {value: true, description: "Messages"},
spamMessages: {value: true, description: "Spam Messages"},
ignoredMessages: {value: true, description: "Ignored Messages"},
pins: {value: true, description: "Pinned Messages"}, pins: {value: true, description: "Pinned Messages"},
inbox: {value: true, description: "Inbox Messages"}, inbox: {value: true, description: "Inbox Messages"},
replies: {value: true, description: "Message Preview in Replies"}, replies: {value: true, description: "Message Preview in Replies"},
@ -262,7 +264,7 @@ module.exports = (_ => {
processMessages (e) { processMessages (e) {
if (!this.settings.places.messages && !this.settings.places.repliesToBlocked) return; if (!this.settings.places.messages && !this.settings.places.repliesToBlocked) return;
if (BDFDB.ArrayUtils.is(e.instance.props.channelStream)) { if (BDFDB.ArrayUtils.is(e.instance.props.channelStream)) {
let oldStream = e.instance.props.channelStream.filter(n => !(this.settings.places.messages && n.type == "MESSAGE_GROUP_BLOCKED") && !(this.settings.places.repliesToBlocked && n.content.messageReference && BDFDB.LibraryStores.RelationshipStore.isBlocked((BDFDB.LibraryStores.MessageStore.getMessage(n.content.messageReference.channel_id, n.content.messageReference.message_id) || {author: {}}).author.id))); let oldStream = e.instance.props.channelStream.filter(n => !(this.settings.places.messages && n.type == "MESSAGE_GROUP_BLOCKED") && !(this.settings.places.spamMessages && n.type == "MESSAGE_GROUP_SPAMMER") && !(this.settings.places.ignoredMessages && n.type == "MESSAGE_GROUP_IGNORED") && !(this.settings.places.repliesToBlocked && n.content.messageReference && BDFDB.LibraryStores.RelationshipStore.isBlocked((BDFDB.LibraryStores.MessageStore.getMessage(n.content.messageReference.channel_id, n.content.messageReference.message_id) || {author: {}}).author.id)));
let newStream = []; let newStream = [];
if (oldStream.length != e.instance.props.channelStream.length) { if (oldStream.length != e.instance.props.channelStream.length) {
for (let i in oldStream) { for (let i in oldStream) {