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