Changeset 0f9eca7 for perlwrap.pm


Ignore:
Timestamp:
Aug 3, 2008, 10:00:30 PM (13 years ago)
Author:
Geoffrey Thomas <geofft@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
d81f8d0
Parents:
719c699
Message:
Add a hook, newMessage, that catches every message that's added to the message
list. receiveMessage only sees incoming messages, and I don't want to change
that behavior. newMessage is probably most useful for people writing fancy
loggers in Perl.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlwrap.pm

    racb13bb r0f9eca7  
    685685
    686686our @EXPORT_OK = qw($startup $shutdown
    687                     $receiveMessage $mainLoop
    688                     $getBuddyList);
     687                    $receiveMessage $newMessage
     688                    $mainLoop $getBuddyList);
    689689
    690690our %EXPORT_TAGS = (all => [@EXPORT_OK]);
     
    693693our $shutdown = BarnOwl::Hook->new;
    694694our $receiveMessage = BarnOwl::Hook->new;
     695our $newMessage = BarnOwl::Hook->new;
    695696our $mainLoop = BarnOwl::Hook->new;
    696697our $getBuddyList = BarnOwl::Hook->new;
     
    771772}
    772773
     774sub _new_msg {
     775    my $m = shift;
     776
     777    $newMessage->run($m);
     778   
     779    BarnOwl::new_msg($m) if *BarnOwl::new_msg{CODE};
     780}
     781
    773782sub _mainloop_hook {
    774783    $mainLoop->run;
Note: See TracChangeset for help on using the changeset viewer.