Skip to content

Commit

Permalink
Don't duplicate initial lines on reconnect.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbax committed Jul 23, 2020
1 parent 7151e69 commit a456426
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand All @@ -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);
}

Expand Down

0 comments on commit a456426

Please sign in to comment.