3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 11:59:40 +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:
Shivaram Lingamneni 2019-02-13 02:17:56 -05:00
parent 5bd2133946
commit f40c363170

View File

@ -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]
}