Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Hooks.pm

    rb8a3e00 r120dac7  
    3636Called before BarnOwl shutdown
    3737
     38=item $wakeup
     39
     40Called, at most once per second, on user input
     41
    3842=item $receiveMessage
    3943
     
    5761from every function registered with this hook will be appended and
    5862displayed in a popup window, with zephyr formatting parsed.
     63
     64=item $awayOn
     65
     66Called, for all protocol handlers, to go away, with the away message,
     67if any.
     68
     69=item $awayOff
     70
     71Called, for all protocol handlers, to come back from away.
     72
     73=item $getIsAway
     74
     75Called to check away status for all protocol handlers.  Protocol
     76handlers should return a true value if any account of the user is away
     77for the given protocol, and a false value otherwise.
    5978
    6079=item $getQuickstart
     
    7392
    7493our @EXPORT_OK = qw($startup $shutdown
     94                    $wakeup
    7595                    $receiveMessage $newMessage
    7696                    $mainLoop $getBuddyList
     97                    $awayOn $awayOff $getIsAway
    7798                    $getQuickstart);
    7899
     
    83104our $startup = BarnOwl::Hook->new;
    84105our $shutdown = BarnOwl::Hook->new;
     106our $wakeup = BarnOwl::Hook->new;
    85107our $receiveMessage = BarnOwl::Hook->new;
    86108our $newMessage = BarnOwl::Hook->new;
     
    88110our $getBuddyList = BarnOwl::Hook->new;
    89111our $getQuickstart = BarnOwl::Hook->new;
     112our $awayOn = BarnOwl::Hook->new;
     113our $awayOff = BarnOwl::Hook->new;
     114our $getIsAway = BarnOwl::Hook->new;
    90115
    91116# Internal startup/shutdown routines called by the C code
     
    175200}
    176201
     202sub _wakeup {
     203    $wakeup->run;
     204}
     205
    177206sub _receive_msg {
    178207    my $m = shift;
     
    199228sub _get_quickstart {
    200229    return join("\n", $getQuickstart->run);
     230}
     231
     232sub _away_on {
     233    $awayOn->run(@_);
     234}
     235
     236sub _away_off {
     237    $awayOff->run();
     238}
     239
     240sub _get_is_away {
     241    my @is_away = grep { $_ } $getIsAway->run();
     242    return scalar @is_away;
    201243}
    202244
Note: See TracChangeset for help on using the changeset viewer.