chat filter: add option to filter login notifications

Co-authored-by: gregg1494 <gregg1494@gmail.com>
This commit is contained in:
Adam
2019-07-09 13:53:33 -04:00
committed by Adam
parent 7f7a71eb38
commit 62e877de5c
2 changed files with 18 additions and 0 deletions

View File

@@ -86,4 +86,15 @@ public interface ChatFilterConfig extends Config
{
return false;
}
@ConfigItem(
keyName = "filterLogin",
name = "Filter Logged In/Out Messages",
description = "Filter your private chat to remove logged in/out messages",
position = 6
)
default boolean filterLogin()
{
return false;
}
}

View File

@@ -116,6 +116,13 @@ public class ChatFilterPlugin extends Plugin
case MODPRIVATECHAT:
case FRIENDSCHAT:
break;
case LOGINLOGOUTNOTIFICATION:
if (config.filterLogin())
{
// Block the message
intStack[intStackSize - 3] = 0;
}
return;
default:
return;
}