Ignore:
Timestamp:
Sep 30, 2009, 9:32:36 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5b483a6
Parents:
9300fe5
git-author:
Nelson Elhage <nelhage@mit.edu> (09/19/09 20:18:35)
git-committer:
Nelson Elhage <nelhage@mit.edu> (09/30/09 21:32:36)
Message:
IRC Completion: Use networks and channels from the IRC module.
File:
1 edited

Legend:

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

    r216b1d0 r27a1903  
    66use BarnOwl::Completion::Util qw(complete_flags);
    77
    8 my %networks = ();
    9 my %dests = ();
    10 my %servers = ();
     8our %users = ();
     9our %servers = ();
    1110
    12 sub complete_networks { keys %networks }
    13 sub complete_dests    { keys %dests }
    14 sub complete_channels { grep /^#/, keys %dests }
    15 sub complete_nicks    { grep /^[^#]/, keys %dests }
     11sub complete_networks { keys %BarnOwl::Module::IRC::ircnets }
     12sub complete_dests    { keys %users, complete_channels() }
     13sub complete_channels { keys %BarnOwl::Module::IRC::channels }
     14sub complete_nicks    { keys %users }
    1615sub complete_servers  { keys %servers }
    1716
     
    7574    my $m = shift;
    7675    return unless $m->type eq 'IRC';
    77     $networks{$m->network} = 1;
    78     $dests{$m->recipient} = 1;
    79     $dests{$m->sender} = 1;
     76    if ($m->recipient !~ m{^#}) {
     77        $users{$m->recipient} = 1;
     78    }
     79    if ($m->sender !~ m{^#}) {
     80        $users{$m->sender} = 1;
     81    }
    8082    $servers{$m->server} = 1;
    8183}
Note: See TracChangeset for help on using the changeset viewer.