Changeset 5625001 for perl/modules/IRC/lib
- Timestamp:
- Mar 11, 2013, 2:53:52 PM (12 years ago)
- Children:
- 8b2419c
- Parents:
- 3496369
- git-author:
- Edward Z. Yang <ezyang@mit.edu> (01/03/13 13:15:23)
- git-committer:
- Edward Z. Yang <ezyang@mit.edu> (03/11/13 14:53:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
rb8a3e00 r5625001 129 129 argument listed above, and die if no channel argument can be found. 130 130 131 =item C<CHANNEL_OR_USER> 132 133 Pass the channel argument, but accept it if it's a username (e.g. 134 has no hash). Only relevant with C<CHANNEL_ARG>. 135 131 136 =item C<CHANNEL_OPTIONAL> 132 137 … … 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_OR_USER => 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_OR_USER|CHANNEL_ARG|CHANNEL_OPTIONAL ), 191 197 { 192 198 summary => 'Send an IRC message', … … 591 597 $conn ||= $c; 592 598 } 599 } elsif (defined($channel) && ($flags & CHANNEL_OR_USER)) { 600 shift @ARGV; 593 601 } elsif ($m && $m->type eq 'IRC' && !$m->is_private) { 594 602 $channel = $m->channel;
Note: See TracChangeset
for help on using the changeset viewer.