Ignore:
Timestamp:
Apr 3, 2011, 3:06:00 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
4787581
Parents:
8ba9313
git-author:
Nelson Elhage <nelhage@mit.edu> (02/26/11 16:37:52)
git-committer:
Nelson Elhage <nelhage@mit.edu> (04/03/11 15:06:00)
Message:
Handle NICK messages from the server.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r8ba9313 r38d50c2  
    8080                        irc_402       => sub { shift; $self->on_nosuch(@_) },
    8181                        irc_403       => sub { shift; $self->on_nosuch(@_) },
     82                        nick_change  => sub { shift; $self->on_nick(@_); },
    8283                        'irc_*' => sub { BarnOwl::debug("IRC: " . $_[1]->{command}) });
    8384
     
    227228}
    228229
     230sub on_nick {
     231    my ($self, $old_nick, $new_nick, $is_me) = @_;
     232    if ($is_me) {
     233        BarnOwl::admin_message("IRC",
     234                               "[" . $self->alias . "] " .
     235                               "You are now known as $new_nick");
     236    } else {
     237        BarnOwl::admin_message("IRC",
     238                               "[" . $self->alias . "] " .
     239                               "$old_nick is now known as $new_nick");
     240    }
     241}
     242
    229243sub on_topic {
    230244    my ($self, $channel, $topic, $who) = @_;
Note: See TracChangeset for help on using the changeset viewer.