chatnotifications: add private message notification

This commit is contained in:
Broooklyn
2021-02-03 20:43:22 -05:00
parent e71b18b02b
commit bf69f263b0
2 changed files with 18 additions and 0 deletions

View File

@@ -108,4 +108,15 @@ public interface ChatNotificationsConfig extends Config
{
return false;
}
@ConfigItem(
position = 7,
keyName = "notifyOnPM",
name = "Notify on private message",
description = "Notifies you whenever you receive a private message"
)
default boolean notifyOnPM()
{
return false;
}
}

View File

@@ -165,6 +165,13 @@ public class ChatNotificationsPlugin extends Plugin
notifier.notify(Text.removeFormattingTags(broadcast));
}
break;
case PRIVATECHAT:
case MODPRIVATECHAT:
if (config.notifyOnPM())
{
notifier.notify(Text.removeTags(chatMessage.getName()) + ": " + chatMessage.getMessage());
}
break;
case CONSOLE:
// Don't notify for notification messages
if (chatMessage.getName().equals(runeliteTitle))