Changeset f094fc4 for perl/modules/IRC/lib
- Timestamp:
- May 5, 2008, 2:56:52 PM (16 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:
- 8df6cbb
- Parents:
- 811ad93
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
r919535f rf094fc4 114 114 BarnOwl::new_command('irc-whois' => \&cmd_whois); 115 115 BarnOwl::new_command('irc-motd' => \&cmd_motd); 116 BarnOwl::new_command('irc-list' => \&cmd_list); 117 BarnOwl::new_command('irc-who' => \&cmd_who); 118 BarnOwl::new_command('irc-stats' => \&cmd_stats); 116 119 } 117 120 … … 146 149 $host = shift @ARGV or die("Usage: $cmd HOST\n"); 147 150 if(!$alias) { 148 if($host =~ /^(?:irc[.])?( \w+)[.]\w+$/) {151 if($host =~ /^(?:irc[.])?([\w-]+)[.]\w+$/) { 149 152 $alias = $1; 150 153 } else { … … 152 155 } 153 156 } 154 $port = shift @ARGV || 6667;155 157 $ssl ||= 0; 158 $port = shift @ARGV || ($ssl ? 6697 : 6667); 156 159 } 157 160 … … 275 278 } 276 279 280 sub cmd_list { 281 my $cmd = shift; 282 my $message = BarnOwl::Style::boldify('Current IRC networks:') . "\n"; 283 while (my ($alias, $conn) = each %ircnets) { 284 $message .= ' ' . $alias . ' => ' . $conn->nick . '@' . $conn->server . "\n"; 285 } 286 BarnOwl::popless_ztext($message); 287 } 288 289 sub cmd_who { 290 my $cmd = shift; 291 my $conn = get_connection(\@_); 292 my $who = shift || die("Usage: $cmd <user>\n"); 293 $conn->conn->who($who); 294 } 295 296 sub cmd_stats { 297 my $cmd = shift; 298 my $conn = get_connection(\@_); 299 my $type = shift || die("Usage: $cmd <chiklmouy> [server] \n"); 300 $conn->conn->stats($type, @_); 301 } 302 277 303 ################################################################################ 278 304 ########################### Utilities/Helpers ##################################
Note: See TracChangeset
for help on using the changeset viewer.