Changeset fe8cad8 for perl/modules
- Timestamp:
- Jan 11, 2008, 5:11:00 PM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 216e621
- Parents:
- 9e02bb7
- git-author:
- Alex Vandiver <alexmv@mit.edu> (01/11/08 17:08:47)
- git-committer:
- Alex Vandiver <alexmv@mit.edu> (01/11/08 17:11:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
rb0c8011 rfe8cad8 28 28 # Hash alias -> BarnOwl::Module::IRC::Connection object 29 29 our %ircnets; 30 our %channels; 30 31 31 32 sub startup { … … 210 211 my $conn = get_connection(\@_); 211 212 my $chan = shift or die("Usage: $cmd channel\n"); 213 $channels{$chan} ||= []; 214 push @{$channels{$chan}}, $conn; 212 215 $conn->join($chan); 213 216 } … … 217 220 my $conn = get_connection(\@_); 218 221 my $chan = get_channel(\@_) || die("Usage: $cmd <channel>\n"); 222 $channels{$chan} = [grep {$_ ne $conn} @{$channels{$chan} || []}]; 219 223 $conn->part($chan); 220 224 } … … 251 255 return get_connection_by_alias(shift @$args); 252 256 } 257 my $channel = $args->[-1]; 258 if ($channel =~ /^#/ and $channels{$channel} and @{$channels{$channel}} == 1) { 259 return $channels{$channel}[0]; 260 } 253 261 my $m = BarnOwl::getcurmsg(); 254 262 if($m && $m->type eq 'IRC') {
Note: See TracChangeset
for help on using the changeset viewer.