Ignore:
Timestamp:
Oct 18, 2009, 4:00:18 PM (15 years ago)
Author:
Alex Vandiver <alexmv@mit.edu>
Branches:
master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
cc1a6d4
Parents:
f3678c3
git-author:
Alex Vandiver <alexmv@mit.edu> (10/15/09 14:29:41)
git-committer:
Alex Vandiver <alexmv@mit.edu> (10/18/09 16:00:18)
Message:
Add IRC server and channel listing to buddylist
File:
1 edited

Legend:

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

    r69c3878 rda554da  
    7979}
    8080
     81sub buddylist {
     82    my $list = "";
     83
     84    for my $net (sort keys %ircnets) {
     85        my $conn = $ircnets{$net};
     86        my ($nick, $server) = ($conn->nick, $conn->server);
     87        $list .= BarnOwl::Style::boldify("IRC channels for $net ($nick\@$server)\n");
     88
     89        for my $chan (keys %channels) {
     90            next unless grep $_ eq $conn, @{$channels{$chan}};
     91            $list .= "  $chan\n";
     92        }
     93        $list .= "\n";
     94    }
     95
     96    return $list;
     97}
     98
    8199#sub mainloop_hook {
    82100#    return unless defined $irc;
     
    306324$BarnOwl::Hooks::shutdown->add('BarnOwl::Module::IRC::shutdown');
    307325$BarnOwl::Hooks::getQuickstart->add('BarnOwl::Module::IRC::quickstart');
     326$BarnOwl::Hooks::getBuddyList->add("BarnOwl::Module::IRC::buddylist");
    308327
    309328################################################################################
Note: See TracChangeset for help on using the changeset viewer.