Changeset 5da6ed8


Ignore:
Timestamp:
Jul 31, 2009, 1:50:06 AM (8 years ago)
Author:
Kevin Riggle <kevinr@free-dissociation.com>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
82e0f26
Parents:
0b13bbc
Message:
Include by default replies from users to whom the current user is not subscribed.
File:
1 edited

Legend:

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

    r0b13bbc r5da6ed8  
    3838        poll_for_dms     => 1,
    3939        publish_tweets   => 1,
     40        show_unsubscribed_replies => 1,
    4041        %$cfg
    4142       };
     
    111112        return;
    112113    };
     114
     115    if ($self->{cfg}->{show_unsubscribed_replies}) {
     116        my $mentions = $self->{twitter}->mentions( { since_id => $self->{last_id} } );
     117        unless (defined($mentions) && ref($mentions) eq 'ARRAY') {
     118            $self->twitter_error();
     119            return;
     120        };
     121        #combine, sort by id, and uniq
     122        push @$timeline, @$mentions;
     123        @$timeline = sort { $b->{id} <=> $a->{id} } @$timeline;
     124        my $prev = { id => 0 };
     125        @$timeline = grep($_->{id} != $prev->{id} && (($prev) = $_), @$timeline);
     126    }
     127
    113128    if ( scalar @$timeline ) {
    114129        for my $tweet ( reverse @$timeline ) {
Note: See TracChangeset for help on using the changeset viewer.