temporarily fix
this can be bypassed with something like random strings i am not sure how to make it auto reconnect yet but should be simple
This commit is contained in:
parent
031c592b33
commit
c0a1681b27
1 changed files with 13 additions and 5 deletions
|
@ -23,6 +23,8 @@ public class IRCPlugin extends IRCMessageLoop {
|
|||
|
||||
private final Map<String, List<String>> messageQueue = new HashMap<>();
|
||||
|
||||
private String lastMessage = "";
|
||||
|
||||
public IRCPlugin (Configuration config) {
|
||||
super(config.irc.host, config.irc.port);
|
||||
|
||||
|
@ -133,13 +135,19 @@ public class IRCPlugin extends IRCMessageLoop {
|
|||
final String stringifiedName = ComponentUtilities.stringify(message.displayName);
|
||||
final String stringifiedContents = ComponentUtilities.stringify(message.contents);
|
||||
|
||||
addMessageToQueue(
|
||||
bot,
|
||||
String.format(
|
||||
final String toSend = String.format(
|
||||
"<%s> %s",
|
||||
stringifiedName,
|
||||
stringifiedContents
|
||||
)
|
||||
);
|
||||
|
||||
if (lastMessage.equals(toSend)) return;
|
||||
|
||||
lastMessage = toSend;
|
||||
|
||||
addMessageToQueue(
|
||||
bot,
|
||||
toSend
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue