source: lib/BarnOwl/Message/Twitter.pm @ 6babb75

release-1.7release-1.8release-1.9
Last change on this file since 6babb75 was 6babb75, checked in by Nelson Elhage <nelhage@mit.edu>, 13 years ago
Apply Jesse's @reply patch.
  • Property mode set to 100644
File size: 907 bytes
RevLine 
[8618438]1use warnings;
2use strict;
3
4=head1 NAME
5
6BarnOwl::Message::Twitter
7
8=head1 DESCRIPTION
9
10=cut
11
12package BarnOwl::Message::Twitter;
13use base qw(BarnOwl::Message);
14
15sub context {'twitter'}
16sub subcontext {undef}
17sub long_sender {"http://twitter.com/" . shift->sender}
18
[927c186]19sub replycmd {
20    my $self = shift;
[b4b5a7e]21    if($self->is_private) {
[927c186]22        return $self->replysendercmd;
23    } else {
[6babb75]24        return 'twitter-atreply '.$self->sender;
[927c186]25    }
26}
27
28sub replysendercmd {
29    my $self = shift;
30    return 'twitter-direct ' . $self->sender;
31}
[8618438]32
33sub smartfilter {
34    my $self = shift;
35    my $inst = shift;
36    my $filter;
37
38    if($inst) {
39        $filter = "twitter-" . $self->sender;
40        BarnOwl::command("filter", $filter,
41                         qw{type ^twitter$ and sender}, '^'.$self->sender.'$');
42    } else {
43        $filter = "twitter";
44    }
45    return $filter;
46}
47
48=head1 SEE ALSO
49
50Foo, Bar, Baz
51
52=cut
53
541;
Note: See TracBrowser for help on using the repository browser.