Merge pull request #13157 from Broooklyn/pm-notification

chatnotifications: add private message notification
This commit is contained in:
Jordan
2021-02-06 22:56:01 +00:00
committed by GitHub
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))