Changeset f81176c


Ignore:
Timestamp:
Dec 17, 2009, 10:52:39 PM (10 years ago)
Author:
Alex Vandiver <alexmv@mit.edu>
Branches:
master, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
99c1f46
Parents:
cd12307
git-author:
Alex Vandiver <alexmv@mit.edu> (10/16/09 01:23:08)
git-committer:
Alex Vandiver <alexmv@mit.edu> (12/17/09 22:52:39)
Message:
Skip some IRC admin messages by default, controlled by irc:skip
Location:
perl/modules/IRC/lib/BarnOwl/Module
Files:
2 edited

Legend:

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

    rcd12307 rf81176c  
    5959        'admin messages. Intended for debugging and development use only.'
    6060       });
    61    
     61
     62    BarnOwl::new_variable_string('irc:skip', {
     63        default     => 'welcome yourhost created ' .
     64        'luserclient luserme luserop luserchannels',
     65        summary     => 'Skip messages of these types',
     66        description => 'If set, each (space-separated) message type ' .
     67        'provided will be hidden and ignored if received.'
     68       });
     69
    6270    register_commands();
    6371    register_handlers();
     
    120128        $irc->timeout(0);
    121129    }
     130}
     131
     132sub skip_msg {
     133    my $class = shift;
     134    my $type = lc shift;
     135    my $skip = lc BarnOwl::getvar('irc:skip');
     136    return grep {$_ eq $type} split ' ', $skip;
    122137}
    123138
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r3b4ba7d rf81176c  
    131131sub on_admin_msg {
    132132    my ($self, $evt) = @_;
     133    return if BarnOwl::Module::IRC->skip_msg($evt->type);
    133134    BarnOwl::admin_message("IRC",
    134135            BarnOwl::Style::boldify('IRC ' . $evt->type . ' message from '
Note: See TracChangeset for help on using the changeset viewer.