- Timestamp:
- Jul 25, 2008, 11:59:40 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- a1a2036
- Parents:
- d264c6d
- Location:
- perl/modules/IRC/lib/BarnOwl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Message/IRC.pm
rf151757 r4789b17 56 56 sub network {shift->{network}} 57 57 sub channel {shift->{channel}} 58 sub action {shift->{action}} 59 sub reason {shift->{reason}} 58 60 59 61 # display … … 65 67 sub login_type { 66 68 my $self = shift; 67 return " (" . ($self->is_login ? "JOIN" : "PART"). ")";69 return " (" . uc $self->action . ")"; 68 70 } 69 71 70 sub login_extra { shift->channel; } 71 72 sub login_extra { 73 my $self = shift; 74 if ($self->action eq "quit") { 75 return $self->reason; 76 } else { 77 return $self->channel; 78 } 79 } 72 80 73 81 1; -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
rd264c6d r4789b17 64 64 $self->conn->add_handler(join => sub { shift; $self->on_join(@_) }); 65 65 $self->conn->add_handler(part => sub { shift; $self->on_part(@_) }); 66 $self->conn->add_handler(quit => sub { shift; $self->on_quit(@_) }); 66 67 $self->conn->add_handler(disconnect => sub { shift; $self->on_disconnect(@_) }); 67 68 $self->conn->add_handler(nicknameinuse => sub { shift; $self->on_nickinuse(@_) }); … … 164 165 my $msg = $self->new_message($evt, 165 166 loginout => 'login', 167 action => 'join', 166 168 channel => $evt->to, 167 169 replycmd => 'irc-msg -a ' . $self->alias . ' ' . join(' ', $evt->to), … … 175 177 my $msg = $self->new_message($evt, 176 178 loginout => 'logout', 179 action => 'part', 177 180 channel => $evt->to, 178 181 replycmd => 'irc-msg -a ' . $self->alias . ' ' . join(' ', $evt->to), 182 replysendercmd => 'irc-msg -a ' . $self->alias . ' ' . $evt->nick 183 ); 184 BarnOwl::queue_message($msg); 185 } 186 187 sub on_quit { 188 my ($self, $evt) = @_; 189 my $msg = $self->new_message($evt, 190 loginout => 'logout', 191 action => 'quit', 192 from => $evt->to, 193 reason => [$evt->args]->[0], 194 replycmd => 'irc-msg -a ' . $self->alias . ' ' . $evt->nick, 179 195 replysendercmd => 'irc-msg -a ' . $self->alias . ' ' . $evt->nick 180 196 );
Note: See TracChangeset
for help on using the changeset viewer.