forked from External/ergo
use server.name and server.nameString, name for checking and getting nice comparison, nameString for reply outputs
This commit is contained in:
parent
7b13858f8c
commit
2a519c8061
5 changed files with 46 additions and 44 deletions
|
|
@ -96,23 +96,23 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
|||
// 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)
|
||||
client.Send(nil, server.name, "CAP", client.nickString, subCommand, SupportedCapabilities.String())
|
||||
client.Send(nil, server.nameString, "CAP", client.nickString, subCommand, SupportedCapabilities.String())
|
||||
|
||||
case "LIST":
|
||||
client.Send(nil, server.name, "CAP", client.nickString, subCommand, client.capabilities.String())
|
||||
client.Send(nil, server.nameString, "CAP", client.nickString, subCommand, client.capabilities.String())
|
||||
|
||||
case "REQ":
|
||||
// make sure all capabilities actually exist
|
||||
for capability := range capabilities {
|
||||
if !SupportedCapabilities[capability] {
|
||||
client.Send(nil, server.name, "CAP", client.nickString, subCommand, capString)
|
||||
client.Send(nil, server.nameString, "CAP", client.nickString, subCommand, capString)
|
||||
return false
|
||||
}
|
||||
}
|
||||
for capability := range capabilities {
|
||||
client.capabilities[capability] = true
|
||||
}
|
||||
client.Send(nil, server.name, "CAP", client.nickString, subCommand, capString)
|
||||
client.Send(nil, server.nameString, "CAP", client.nickString, subCommand, capString)
|
||||
|
||||
case "END":
|
||||
if !client.registered {
|
||||
|
|
@ -121,7 +121,7 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
|||
}
|
||||
|
||||
default:
|
||||
client.Send(nil, server.name, ERR_INVALIDCAPCMD, client.nickString, subCommand, "Invalid CAP subcommand")
|
||||
client.Send(nil, server.nameString, ERR_INVALIDCAPCMD, client.nickString, subCommand, "Invalid CAP subcommand")
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue