chat filter: add option to filter login notifications
Co-authored-by: gregg1494 <gregg1494@gmail.com>
This commit is contained in:
@@ -86,4 +86,15 @@ public interface ChatFilterConfig extends Config
|
|||||||
{
|
{
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,13 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
case MODPRIVATECHAT:
|
case MODPRIVATECHAT:
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
break;
|
break;
|
||||||
|
case LOGINLOGOUTNOTIFICATION:
|
||||||
|
if (config.filterLogin())
|
||||||
|
{
|
||||||
|
// Block the message
|
||||||
|
intStack[intStackSize - 3] = 0;
|
||||||
|
}
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user