Update RemoveBlockedMessages.plugin.js

This commit is contained in:
Mirco Wittrien 2020-03-31 21:53:56 +02:00
parent bf67fe27a7
commit af779274ee
1 changed files with 3 additions and 6 deletions

View File

@ -4,17 +4,13 @@ var RemoveBlockedMessages = (_ => {
return class RemoveBlockedMessages { return class RemoveBlockedMessages {
getName () {return "RemoveBlockedMessages";} getName () {return "RemoveBlockedMessages";}
getVersion () {return "1.0.1";} getVersion () {return "1.0.2";}
getAuthor () {return "DevilBro";} getAuthor () {return "DevilBro";}
getDescription () {return "Removes blocked messages completely.";} getDescription () {return "Removes blocked messages completely.";}
constructor () { constructor () {
this.changelog = {
"fixed":[["Scroll Jump","Fixed issue where chat scroller would jump to the top if last unread messages was a blocked message"]]
};
this.patchedModules = { this.patchedModules = {
before: { before: {
Messages: "render" Messages: "render"
@ -72,6 +68,7 @@ var RemoveBlockedMessages = (_ => {
// begin of own functions // begin of own functions
processMessages (e) { processMessages (e) {
if (BDFDB.ArrayUtils.is(e.instance.props.channelStream)) e.instance.props.channelStream = [].concat(e.instance.props.channelStream.filter(n => n.type != "MESSAGE_GROUP_BLOCKED"));
if (BDFDB.ObjectUtils.is(e.instance.props.messages) && BDFDB.ArrayUtils.is(e.instance.props.messages._array)) { if (BDFDB.ObjectUtils.is(e.instance.props.messages) && BDFDB.ArrayUtils.is(e.instance.props.messages._array)) {
let messages = e.instance.props.messages; let messages = e.instance.props.messages;
e.instance.props.messages = new BDFDB.DiscordObjects.Messages(messages); e.instance.props.messages = new BDFDB.DiscordObjects.Messages(messages);