Changeset a38becd for perl


Ignore:
Timestamp:
Aug 8, 2013, 2:38:50 PM (11 years ago)
Author:
Edward Z. Yang <ezyang@mit.edu>
Branches:
master, release-1.10
Children:
120dac7
Parents:
4f7b1f4
git-author:
Jason Gross <jgross@mit.edu> (05/27/11 17:39:59)
git-committer:
Edward Z. Yang <ezyang@mit.edu> (08/08/13 14:38:50)
Message:
Added a perl hook for :away

Note: The sepbar no longer distinguishes between AWAY, A-AWAY, and
Z-AWAY.
File:
1 edited

Legend:

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

    rb8a3e00 ra38becd  
    5757from every function registered with this hook will be appended and
    5858displayed in a popup window, with zephyr formatting parsed.
     59
     60=item $awayOn
     61
     62Called, for all protocol handlers, to go away, with the away message,
     63if any.
     64
     65=item $awayOff
     66
     67Called, for all protocol handlers, to come back from away.
     68
     69=item $getIsAway
     70
     71Called to check away status for all protocol handlers.  Protocol
     72handlers should return a true value if any account of the user is away
     73for the given protocol, and a false value otherwise.
    5974
    6075=item $getQuickstart
     
    7590                    $receiveMessage $newMessage
    7691                    $mainLoop $getBuddyList
     92                    $awayOn $awayOff $getIsAway
    7793                    $getQuickstart);
    7894
     
    88104our $getBuddyList = BarnOwl::Hook->new;
    89105our $getQuickstart = BarnOwl::Hook->new;
     106our $awayOn = BarnOwl::Hook->new;
     107our $awayOff = BarnOwl::Hook->new;
     108our $getIsAway = BarnOwl::Hook->new;
    90109
    91110# Internal startup/shutdown routines called by the C code
     
    201220}
    202221
     222sub _away_on {
     223    $awayOn->run(@_);
     224}
     225
     226sub _away_off {
     227    $awayOff->run();
     228}
     229
     230sub _get_is_away {
     231    my @is_away = grep { $_ } $getIsAway->run();
     232    return scalar @is_away;
     233}
     234
    203235sub _new_command {
    204236    my $command = shift;
Note: See TracChangeset for help on using the changeset viewer.