3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 20:09:41 +01:00

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

View File

@ -13,10 +13,6 @@ func (m *NickCommand) HandleRegServer(s *Server) {
return return
} }
if client.capState == CapNegotiating {
client.capState = CapNegotiated
}
if m.nickname == "" { if m.nickname == "" {
client.ErrNoNicknameGiven() client.ErrNoNicknameGiven()
return return

View File

@ -179,7 +179,10 @@ func RplKill(client *Client, target *Client, comment Text) string {
} }
func RplCap(client *Client, subCommand CapSubCommand, arg interface{}) 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 // numeric replies

View File

@ -387,9 +387,6 @@ func (msg *RFC2812UserCommand) HandleRegServer(server *Server) {
func (msg *UserCommand) setUserInfo(server *Server) { func (msg *UserCommand) setUserInfo(server *Server) {
client := msg.Client() client := msg.Client()
if client.capState == CapNegotiating {
client.capState = CapNegotiated
}
server.clients.Remove(client) server.clients.Remove(client)
client.username, client.realname = msg.username, msg.realname client.username, client.realname = msg.username, msg.realname