cap: Properly suspend registration for CAP negotiation

This commit is contained in:
Daniel Oaks
2016-04-14 11:25:23 +10:00
parent 50a571ce8e
commit 0ccabead31
3 changed files with 4 additions and 8 deletions
-4
View File
@@ -13,10 +13,6 @@ func (m *NickCommand) HandleRegServer(s *Server) {
return
}
if client.capState == CapNegotiating {
client.capState = CapNegotiated
}
if m.nickname == "" {
client.ErrNoNicknameGiven()
return
+4 -1
View File
@@ -179,7 +179,10 @@ func RplKill(client *Client, target *Client, comment Text) string {
}
func RplCap(client *Client, subCommand CapSubCommand, arg interface{}) string {
return NewStringReply(nil, CAP, "%s %s :%s", client.Nick(), subCommand, arg)
// client.server needs to be here to workaround a parsing bug in weechat 1.4
// and let it connect to the server (otherwise it doesn't respond to the CAP
// message with anything and just hangs on connection)
return NewStringReply(client.server, CAP, "%s %s :%s", client.Nick(), subCommand, arg)
}
// numeric replies
-3
View File
@@ -387,9 +387,6 @@ func (msg *RFC2812UserCommand) HandleRegServer(server *Server) {
func (msg *UserCommand) setUserInfo(server *Server) {
client := msg.Client()
if client.capState == CapNegotiating {
client.capState = CapNegotiated
}
server.clients.Remove(client)
client.username, client.realname = msg.username, msg.realname