mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-26 05:49:25 +01:00
cap: Properly suspend registration for CAP negotiation
This commit is contained in:
parent
50a571ce8e
commit
0ccabead31
@ -13,10 +13,6 @@ func (m *NickCommand) HandleRegServer(s *Server) {
|
||||
return
|
||||
}
|
||||
|
||||
if client.capState == CapNegotiating {
|
||||
client.capState = CapNegotiated
|
||||
}
|
||||
|
||||
if m.nickname == "" {
|
||||
client.ErrNoNicknameGiven()
|
||||
return
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user