runelite-client: Prevent recursion when chat notifier notifies to chat
This commit is contained in:
@@ -40,6 +40,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.SetMessage;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -65,6 +66,9 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
private RuneLiteProperties runeLiteProperties;
|
||||
|
||||
//Custom Highlights
|
||||
private Pattern usernameMatcher = null;
|
||||
private String usernameReplacer = "";
|
||||
@@ -137,6 +141,13 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
notifier.notify(event.getValue());
|
||||
}
|
||||
break;
|
||||
case GAME:
|
||||
// Don't notify for notification messages
|
||||
if (event.getName().equals(runeLiteProperties.getTitle()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (usernameMatcher == null && client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null)
|
||||
|
||||
Reference in New Issue
Block a user