Remove tags from chat notifications (#7608)

- Remove tags from chat notifications matcher
- Remove tags from chat notifications notifier

Resolves #7596 
Resolves #7371
This commit is contained in:
4444N
2019-01-30 03:35:10 -05:00
committed by Tomas Slusny
parent 53a1a9bb7f
commit e5503efd1a

View File

@@ -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);
}