mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-13 07:29:30 +01:00
compatibility mode for NS IDENTIFY
Standard nickserv clients like znc's expect (by default) to send just: PRIVMSG NickServ :identify $passphrase with the account name assumed to be the currently held nick. Let's support this in the common case where the client doesn't have a certfp (if it does, the first argument is the account name, not the passphrase).
This commit is contained in:
parent
5bd2133946
commit
f40c363170
@ -256,9 +256,18 @@ func nsIdentifyHandler(server *Server, client *Client, command string, params []
|
||||
|
||||
loginSuccessful := false
|
||||
|
||||
username := params[0]
|
||||
var passphrase string
|
||||
if len(params) > 1 {
|
||||
var username, passphrase string
|
||||
if len(params) == 1 {
|
||||
if client.certfp != "" {
|
||||
username = params[0]
|
||||
} else {
|
||||
// XXX undocumented compatibility mode with other nickservs, allowing
|
||||
// /msg NickServ identify passphrase
|
||||
username = client.NickCasefolded()
|
||||
passphrase = params[0]
|
||||
}
|
||||
} else {
|
||||
username = params[0]
|
||||
passphrase = params[1]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user