From e5503efd1aa81decf129eee10b5662cf45af1292 Mon Sep 17 00:00:00 2001 From: 4444N <39735358+4444N@users.noreply.github.com> Date: Wed, 30 Jan 2019 03:35:10 -0500 Subject: [PATCH] Remove tags from chat notifications (#7608) - Remove tags from chat notifications matcher - Remove tags from chat notifications notifier Resolves #7596 Resolves #7371 --- .../plugins/chatnotifications/ChatNotificationsPlugin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java index 4571780df0..fd148c1e90 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java @@ -127,6 +127,7 @@ public class ChatNotificationsPlugin extends Plugin public void onSetMessage(SetMessage event) { MessageNode messageNode = event.getMessageNode(); + String nodeValue = Text.removeTags(messageNode.getValue()); boolean update = false; switch (event.getType()) @@ -176,7 +177,7 @@ public class ChatNotificationsPlugin extends Plugin if (highlightMatcher != null) { - Matcher matcher = highlightMatcher.matcher(messageNode.getValue()); + Matcher matcher = highlightMatcher.matcher(nodeValue); boolean found = false; StringBuffer stringBuffer = new StringBuffer(); @@ -217,12 +218,13 @@ public class ChatNotificationsPlugin extends Plugin { stringBuilder.append('[').append(sender).append("] "); } + if (!Strings.isNullOrEmpty(name)) { stringBuilder.append(name).append(": "); } - stringBuilder.append(message.getValue()); + stringBuilder.append(Text.removeTags(message.getValue())); String notification = stringBuilder.toString(); notifier.notify(notification); }