Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set nick in irc_rpl_welcome default handler #20

Merged
merged 1 commit into from
Feb 14, 2015

Conversation

Grinnz
Copy link
Collaborator

@Grinnz Grinnz commented Feb 8, 2015

Some servers (irc.socialgamer.net) may set a different nick on connect without using err_nicknameinuse. This handles that by setting the nick to whatever is received in irc_rpl_welcome.

@@ -492,7 +492,7 @@ sub irc_nick {
my ($self, $message) = @_;
my $old_nick = ($message->{prefix} =~ /^[~&@%+]?(.*?)!/)[0] || '';

if ($old_nick eq $self->nick) {
if (lc $old_nick eq lc $self->nick) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this relaxes the nick change handler because nicks are not case sensitive. (may be needed for e.g. Twitch which lowercases your nick)

jhthorsen pushed a commit that referenced this pull request Feb 14, 2015
set nick in irc_rpl_welcome default handler
@jhthorsen jhthorsen merged commit cff5cb0 into jhthorsen:master Feb 14, 2015
@jhthorsen
Copy link
Owner

Cool! Thanks 👍

@jhthorsen jhthorsen self-assigned this Feb 14, 2015
@Grinnz Grinnz deleted the nick_setter branch February 14, 2015 18:32
jhthorsen pushed a commit that referenced this pull request Feb 15, 2015
      * Fix parsing bug in _read() on unknown numeric IRC event, #21
      * Fix setting nick in irc_rpl_welcome default handler, #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants