cinchrb/cinch — pull request #165 by nickrw (2014-05-13 08:20:31+00:00)
Title: Detect differences in nickname between our copy and a 311 WHOIS reply

User#nick always returns a nick in the same case as the first time the bot saw that user online, because it is cached, case insensitive, in the UserList.

To reproduce, use something like the following:

match /echoname ([^ ]+)$/, :method => :echoname
def echoname(m, user)
uobj = User(user)
m.reply(uobj.nick)
end

* call !echoname someuser (bot replies someuser)
* have the user part the channel, change the case of their name only (someUser)
* call !echoname someUser (bot still replies someuser instead of someUser)

The attached patch detects differences between User#nick and the nickname returned by a 311 WHOIS reply message and calls User#update_nick if necessary.