Ignore:
Timestamp:
Oct 11, 2009, 10:17:51 PM (13 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
d69c37c
Parents:
fe184d4
git-author:
Nelson Elhage <nelhage@mit.edu> (09/16/09 23:03:38)
git-committer:
Nelson Elhage <nelhage@mit.edu> (10/11/09 22:17:51)
Message:
Replace the mainloop hook with BarnOwl's built-in timer support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/BarnOwl/Module/Twitter.pm

    r176434d r36546fa  
    187187}
    188188
    189 sub poll_messages {
    190     return unless @twitter_handles;
    191 
    192     my $handle = $twitter_handles[$next_service_to_poll];
    193     $next_service_to_poll = ($next_service_to_poll + 1) % scalar(@twitter_handles);
    194    
    195     $handle->poll_twitter() if $handle->{cfg}->{poll_for_tweets};
    196     $handle->poll_direct() if $handle->{cfg}->{poll_for_dms};
    197 }
    198 
    199189sub find_account {
    200190    my $name = shift;
     
    322312}
    323313
    324 eval {
    325     $BarnOwl::Hooks::receiveMessage->add("BarnOwl::Module::Twitter::handle_message");
    326     $BarnOwl::Hooks::mainLoop->add("BarnOwl::Module::Twitter::poll_messages");
    327 };
    328 if($@) {
    329     $BarnOwl::Hooks::receiveMessage->add(\&handle_message);
    330     $BarnOwl::Hooks::mainLoop->add(\&poll_messages);
    331 }
    332 
    333314BarnOwl::filter(qw{twitter type ^twitter$});
    334315
Note: See TracChangeset for help on using the changeset viewer.