From f40c3631706ae3bbe8abec9d9d3707f8ce1bf931 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 13 Feb 2019 02:17:56 -0500 Subject: [PATCH] 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). --- irc/nickserv.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/irc/nickserv.go b/irc/nickserv.go index 2d3113c0..eccc0464 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -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] }