Last change
on this file since 61d7594 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
|
Line | |
---|
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"}; } |
---|
16 | sub subcontext { return shift->{"topic"}; } |
---|
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 |
---|
24 | return BarnOwl::quote('facebook-comment', $self->{post_id}); |
---|
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; |
---|
35 | # XXX I hope $filter isn't used for anything besides display purposes |
---|
36 | if($inst) { |
---|
37 | $filter = "facebook: " . $self->{name} . " " . $self->{post_id}; |
---|
38 | BarnOwl::command("filter", $filter, |
---|
39 | qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$', |
---|
40 | qw{and post_id}, '^'.$self->{post_id}.'$'); |
---|
41 | } else { |
---|
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.