{"action":"created","issue":{"url":"https://api.github.com/repos/cinchrb/cinch/issues/165","labels_url":"https://api.github.com/repos/cinchrb/cinch/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/cinchrb/cinch/issues/165/comments","events_url":"https://api.github.com/repos/cinchrb/cinch/issues/165/events","html_url":"https://github.com/cinchrb/cinch/pull/165","id":33377275,"number":165,"title":"Detect differences in nickname between our copy and a 311 WHOIS reply","user":{"login":"nickrw","id":38138,"avatar_url":"https://avatars.githubusercontent.com/u/38138?v=3","gravatar_id":"","url":"https://api.github.com/users/nickrw","html_url":"https://github.com/nickrw","followers_url":"https://api.github.com/users/nickrw/followers","following_url":"https://api.github.com/users/nickrw/following{/other_user}","gists_url":"https://api.github.com/users/nickrw/gists{/gist_id}","starred_url":"https://api.github.com/users/nickrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickrw/subscriptions","organizations_url":"https://api.github.com/users/nickrw/orgs","repos_url":"https://api.github.com/users/nickrw/repos","events_url":"https://api.github.com/users/nickrw/events{/privacy}","received_events_url":"https://api.github.com/users/nickrw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-05-13T08:20:31Z","updated_at":"2015-09-08T09:32:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cinchrb/cinch/pulls/165","html_url":"https://github.com/cinchrb/cinch/pull/165","diff_url":"https://github.com/cinchrb/cinch/pull/165.diff","patch_url":"https://github.com/cinchrb/cinch/pull/165.patch"},"body":"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.\r\n\r\nTo reproduce, use something like the following:\r\n\r\n    match /echoname ([^ ]+)$/, :method => :echoname\r\n    def echoname(m, user)\r\n      uobj = User(user)\r\n      m.reply(uobj.nick)\r\n    end\r\n\r\n* call !echoname someuser (bot replies someuser)\r\n* have the user part the channel, change the case of their name only (someUser)\r\n* call !echoname someUser (bot still replies someuser instead of someUser)\r\n\r\nThe attached patch detects differences between User#nick and the nickname returned by a 311 WHOIS reply message and calls User#update_nick if necessary."},"comment":{"url":"https://api.github.com/repos/cinchrb/cinch/issues/comments/138495398","html_url":"https://github.com/cinchrb/cinch/pull/165#issuecomment-138495398","issue_url":"https://api.github.com/repos/cinchrb/cinch/issues/165","id":138495398,"user":{"login":"dominikh","id":39825,"avatar_url":"https://avatars.githubusercontent.com/u/39825?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikh","html_url":"https://github.com/dominikh","followers_url":"https://api.github.com/users/dominikh/followers","following_url":"https://api.github.com/users/dominikh/following{/other_user}","gists_url":"https://api.github.com/users/dominikh/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikh/subscriptions","organizations_url":"https://api.github.com/users/dominikh/orgs","repos_url":"https://api.github.com/users/dominikh/repos","events_url":"https://api.github.com/users/dominikh/events{/privacy}","received_events_url":"https://api.github.com/users/dominikh/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T09:32:03Z","updated_at":"2015-09-08T09:32:03Z","body":"> Is the issue just that you also need the guts of the patch duplicated to #on_354 as well as #on_311?\r\n\r\nYes. Additionally, one would have to verify that these are the only two places this checks needs to be.\r\n\r\n> I'm not really sure how to simulate the IRC messages well enough to unit test the proposed solutions, so it feels a bit like performing surgery in the dark.\r\n\r\nCertain design flaws in Cinch make unit testing a real pain, so it's not something that's generally done."}}