| 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->{"permalink"}; } |
| 19 |
|
| 20 |
sub replycmd { |
| 21 |
my $self = shift; |
| 22 |
return BarnOwl::quote('facebook-comment', $self->{post_id}); |
| 23 |
} |
| 24 |
|
| 25 |
# XXX Messaging not supported yet. |
| 26 |
#sub replysendercmd { |
| 27 |
# my $self = shift; |
| 28 |
#} |
| 29 |
|
| 30 |
sub smartfilter { |
| 31 |
my $self = shift; |
| 32 |
my $inst = shift; |
| 33 |
my $filter; |
| 34 |
# XXX I hope $filter isn't used for anything besides display purposes |
| 35 |
if($inst) { |
| 36 |
$filter = "facebook: " . $self->{name} . " " . $self->{post_id}; |
| 37 |
BarnOwl::command("filter", $filter, |
| 38 |
qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$', |
| 39 |
qw{and post_id}, '^'.$self->{post_id}.'$'); |
| 40 |
} else { |
| 41 |
$filter = "facebook: " . $self->{name}; |
| 42 |
BarnOwl::command("filter", $filter, |
| 43 |
qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$'); |
| 44 |
} |
| 45 |
return $filter; |
| 46 |
} |
| 47 |
|
| 48 |
1; |