diff --git a/src/main/java/org/kitteh/irc/client/library/defaults/DefaultClient.java b/src/main/java/org/kitteh/irc/client/library/defaults/DefaultClient.java index 28d1c2f60..acb4c1e12 100644 --- a/src/main/java/org/kitteh/irc/client/library/defaults/DefaultClient.java +++ b/src/main/java/org/kitteh/irc/client/library/defaults/DefaultClient.java @@ -215,6 +215,7 @@ protected void processElement(@NonNull String element) { private MessageSendingQueue messageSendingScheduled; private final Object messageSendingLock = new Object(); private boolean isSending = false; + private String lastSentUser; private String name; private InetSocketAddress bindAddress; @@ -761,6 +762,9 @@ public void connect() { } this.connection = this.networkHandler.connect(this); + if (this.lastSentUser != null && this.messageSendingImmediate.contains(this.lastSentUser)) { + return; + } this.processor.queue(""); // If we have WebIRC information, send it before everything. @@ -779,7 +783,7 @@ public void connect() { } // Initial USER and NICK messages. Let's just assume we want +iw (send 8) - this.sendRawLineImmediately("USER " + this.userString + " 8 * :" + this.realName); + this.sendRawLineImmediately(this.lastSentUser = "USER " + this.userString + " 8 * :" + this.realName); this.sendNickChange(this.goalNick); }