Changes in / [94eb15b:e0a5480]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    r731e921 r4f7b1f4  
    138138argument listed above, and die if no channel argument can be found.
    139139
     140=item C<CHANNEL_OR_USER>
     141
     142Pass the channel argument, but accept it if it's a username (e.g.
     143has no hash).  Only relevant with C<CHANNEL_ARG>.
     144
    140145=item C<CHANNEL_OPTIONAL>
    141146
     
    154159use constant CHANNEL_ARG        => 1;
    155160use constant CHANNEL_OPTIONAL   => 2;
    156 
    157 use constant ALLOW_DISCONNECTED => 4;
     161use constant CHANNEL_OR_USER    => 4;
     162
     163use constant ALLOW_DISCONNECTED => 8;
    158164
    159165sub register_commands {
     
    197203
    198204    BarnOwl::new_command(
    199         'irc-msg' => mk_irc_command( \&cmd_msg ),
     205        'irc-msg' => mk_irc_command( \&cmd_msg, CHANNEL_OR_USER|CHANNEL_ARG|CHANNEL_OPTIONAL ),
    200206        {
    201207            summary => 'Send an IRC message',
     
    608614                    $conn ||= $c;
    609615                }
     616            } elsif (defined($channel) && ($flags & CHANNEL_OR_USER)) {
     617                shift @ARGV;
    610618            } elsif ($m && $m->type eq 'IRC' && !$m->is_private) {
    611619                $channel = $m->channel;
Note: See TracChangeset for help on using the changeset viewer.