Changeset 8a22ff2
- Timestamp:
- Mar 30, 2013, 7:37:11 PM (11 years ago)
- Children:
- 55758dc
- Parents:
- 0a6a2d6
- git-author:
- William Throwe <wtt6@cornell.edu> (03/30/13 19:16:22)
- git-committer:
- William Throwe <wtt6@cornell.edu> (03/30/13 19:37:11)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
rb8a3e00 r8a22ff2 134 134 with C<CHANNEL_ARG>. 135 135 136 =item C<CHANNEL_EXPLICIT> 137 138 Do not determine the channel from the current message. Only relevant 139 with C<CHANNEL_ARG>. 140 136 141 =item C<ALLOW_DISCONNECTED> 137 142 … … 145 150 use constant CHANNEL_ARG => 1; 146 151 use constant CHANNEL_OPTIONAL => 2; 147 148 use constant ALLOW_DISCONNECTED => 4; 152 use constant CHANNEL_EXPLICIT => 4; 153 154 use constant ALLOW_DISCONNECTED => 8; 149 155 150 156 sub register_commands { … … 188 194 189 195 BarnOwl::new_command( 190 'irc-msg' => mk_irc_command( \&cmd_msg ),196 'irc-msg' => mk_irc_command( \&cmd_msg, CHANNEL_ARG|CHANNEL_OPTIONAL|CHANNEL_EXPLICIT ), 191 197 { 192 198 summary => 'Send an IRC message', 193 usage => 'irc-msg [-a ALIAS] DESTINATION MESSAGE',199 usage => 'irc-msg [-a ALIAS] DESTINATION [MESSAGE]', 194 200 195 201 description => <<END_DESCR … … 407 413 my $cmd = shift; 408 414 my $conn = shift; 409 my $to = shift or die("Usage: $cmd [NICK|CHANNEL]\n");415 my $to = shift || shift or die("Usage: $cmd [NICK|CHANNEL]\n"); 410 416 # handle multiple recipients? 411 417 if(@_) { … … 587 593 $channel = $ARGV[0]; 588 594 if(defined($channel) && $channel =~ /^#/) { 595 shift @ARGV; 589 596 if(my $c = find_channel($channel)) { 590 shift @ARGV;591 597 $conn ||= $c; 592 598 } 593 } elsif ($m && $m->type eq 'IRC' && !$m->is_private) { 599 } elsif (!($flags & CHANNEL_EXPLICIT) && 600 $m && $m->type eq 'IRC' && !$m->is_private) { 594 601 $channel = $m->channel; 595 602 } else {
Note: See TracChangeset
for help on using the changeset viewer.