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.GameStateChanged;
|
||||||
import net.runelite.api.events.SetMessage;
|
import net.runelite.api.events.SetMessage;
|
||||||
import net.runelite.client.Notifier;
|
import net.runelite.client.Notifier;
|
||||||
|
import net.runelite.client.RuneLiteProperties;
|
||||||
import net.runelite.client.chat.ChatColorType;
|
import net.runelite.client.chat.ChatColorType;
|
||||||
import net.runelite.client.chat.ChatMessageManager;
|
import net.runelite.client.chat.ChatMessageManager;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -65,6 +66,9 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private Notifier notifier;
|
private Notifier notifier;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private RuneLiteProperties runeLiteProperties;
|
||||||
|
|
||||||
//Custom Highlights
|
//Custom Highlights
|
||||||
private Pattern usernameMatcher = null;
|
private Pattern usernameMatcher = null;
|
||||||
private String usernameReplacer = "";
|
private String usernameReplacer = "";
|
||||||
@@ -137,6 +141,13 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
notifier.notify(event.getValue());
|
notifier.notify(event.getValue());
|
||||||
}
|
}
|
||||||
break;
|
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)
|
if (usernameMatcher == null && client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user