diff --git a/HubConnection.go b/HubConnection.go index ff9bc87..7d12d93 100644 --- a/HubConnection.go +++ b/HubConnection.go @@ -245,12 +245,7 @@ func (this *HubConnection) processProtocolMessage(message string) { } case "$UserIP": - // Final message in PtokaX connection handshake - trigger connection callback. - // This might not be the case for other hubsofts, though - if this.State != CONNECTIONSTATE_CONNECTED { - this.processEvent(HubEvent{EventType: EVENT_CONNECTION_STATE_CHANGED, StateChange: CONNECTIONSTATE_CONNECTED}) - this.State = CONNECTIONSTATE_CONNECTED - } + // TODO case "$ForceMove": this.Hco.Address = HubAddress(commandParts[1]) @@ -290,11 +285,18 @@ func (this *HubConnection) processProtocolMessage(message string) { if _, ok := this.supports["QuickList"]; ok { this.SayInfo() this.SayRaw("$GetNickList|") - this.sentOurHello = true } else { this.SayRaw("$ValidateNick " + Escape(this.Hco.Self.Nick) + "|") } + // This also counts as the end of the handshake from our POV. Consider + // ourselves logged in + this.sentOurHello = true + if this.State != CONNECTIONSTATE_CONNECTED { + this.processEvent(HubEvent{EventType: EVENT_CONNECTION_STATE_CHANGED, StateChange: CONNECTIONSTATE_CONNECTED}) + this.State = CONNECTIONSTATE_CONNECTED + } + } // IGNORABLE COMMANDS