source: lib/BarnOwl/Message/Twitter.pm @ acdd52e

release-1.7release-1.8release-1.9
Last change on this file since acdd52e was acdd52e, checked in by Nelson Elhage <nelhage@mit.edu>, 12 years ago
Correctly tag replies with the in_reply_to_status_id parameter.
  • Property mode set to 100644
File size: 1.0 KB
Line 
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
19sub 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
30sub replysendercmd {
31    my $self = shift;
32    return 'twitter-direct ' . $self->sender;
33}
34
35sub 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
52Foo, Bar, Baz
53
54=cut
55
561;
Note: See TracBrowser for help on using the repository browser.