Changeset 3ad15ff for perl/modules/IRC/lib/BarnOwl/Module
- Timestamp:
- Jul 23, 2008, 8:18:30 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:
- 38cfdb5d
- Parents:
- 0398d55
- Location:
- perl/modules/IRC/lib/BarnOwl/Module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
rf094fc4 r3ad15ff 117 117 BarnOwl::new_command('irc-who' => \&cmd_who); 118 118 BarnOwl::new_command('irc-stats' => \&cmd_stats); 119 BarnOwl::new_command('irc-topic' => \&cmd_topic); 119 120 } 120 121 … … 301 302 } 302 303 304 sub cmd_topic { 305 my $cmd = shift; 306 my $conn = get_connection(\@_); 307 $conn->conn->topic(@_); 308 } 309 303 310 ################################################################################ 304 311 ########################### Utilities/Helpers ################################## -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
r3835ae8 r3ad15ff 65 65 $self->conn->add_handler(nicknameinuse => sub { shift; $self->on_nickinuse(@_) }); 66 66 $self->conn->add_handler(cping => sub { shift; $self->on_ping(@_) }); 67 $self->conn->add_handler(topic => sub { shift; $self->on_topic(@_) }); 68 $self->conn->add_handler(topicinfo => sub { shift; $self->on_topicinfo(@_) }); 67 69 68 70 return $self; … … 193 195 } 194 196 197 sub on_topic { 198 my ($self, $evt) = @_; 199 my @args = $evt->args; 200 if (scalar @args > 1) { 201 BarnOwl::admin_message("IRC", 202 "Topic for $args[1] on " . $self->alias . " is $args[2]"); 203 } else { 204 BarnOwl::admin_message("IRC", 205 "Topic changed to $args[0]"); 206 } 207 } 208 209 sub on_topicinfo { 210 my ($self, $evt) = @_; 211 my @args = $evt->args; 212 BarnOwl::admin_message("IRC", 213 "Topic for $args[1] set by $args[2] at " . localtime($args[3])); 214 } 215 195 216 sub on_event { 196 217 my ($self, $evt) = @_;
Note: See TracChangeset
for help on using the changeset viewer.