Last change
on this file since 2226f91 was
2226f91,
checked in by Edward Z. Yang <ezyang@mit.edu>, 13 years ago
|
Rename postid to post_id.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[ee98987] | 1 | use warnings; |
---|
| 2 | use strict; |
---|
| 3 | |
---|
| 4 | =head1 NAME |
---|
| 5 | |
---|
| 6 | BarnOwl::Message::Facebook |
---|
| 7 | |
---|
| 8 | =head1 DESCRIPTION |
---|
| 9 | |
---|
| 10 | =cut |
---|
| 11 | |
---|
| 12 | package BarnOwl::Message::Facebook; |
---|
| 13 | use base qw(BarnOwl::Message); |
---|
| 14 | |
---|
| 15 | sub context { return shift->{"name"}; } |
---|
[9da6022] | 16 | sub subcontext { return shift->{"topic"}; } |
---|
[ee98987] | 17 | sub service { return "http://www.facebook.com"; } |
---|
| 18 | sub long_sender { return shift->{"zsig"}; } # XXX hack, shouldn't be named zsig |
---|
| 19 | |
---|
| 20 | sub replycmd { |
---|
| 21 | my $self = shift; |
---|
| 22 | # TODO: Support for direct messages |
---|
| 23 | # XXX: It seems that Facebook may not support this yet |
---|
[2226f91] | 24 | return BarnOwl::quote('facebook-comment', $self->{post_id}); |
---|
[ee98987] | 25 | } |
---|
| 26 | |
---|
| 27 | #sub replysendercmd { |
---|
| 28 | # my $self = shift; |
---|
| 29 | #} |
---|
| 30 | |
---|
| 31 | sub smartfilter { |
---|
| 32 | my $self = shift; |
---|
| 33 | my $inst = shift; |
---|
| 34 | my $filter; |
---|
[b594537] | 35 | # XXX I hope $filter isn't used for anything besides display purposes |
---|
[ee98987] | 36 | if($inst) { |
---|
[2226f91] | 37 | $filter = "facebook: " . $self->{name} . " " . $self->{post_id}; |
---|
[b594537] | 38 | BarnOwl::command("filter", $filter, |
---|
| 39 | qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$', |
---|
[2226f91] | 40 | qw{and post_id}, '^'.$self->{post_id}.'$'); |
---|
[b594537] | 41 | } else { |
---|
[ee98987] | 42 | $filter = "facebook: " . $self->{name}; |
---|
| 43 | BarnOwl::command("filter", $filter, |
---|
| 44 | qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$'); |
---|
| 45 | } |
---|
| 46 | return $filter; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.