source: perl/modules/Facebook/lib/BarnOwl/Message/Facebook.pm @ fb06a17

release-1.9
Last change on this file since fb06a17 was fb06a17, checked in by Edward Z. Yang <ezyang@mit.edu>, 10 years ago
Rename zsig to permalink. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
  • Property mode set to 100644
File size: 1.2 KB
Line 
1use warnings;
2use strict;
3
4=head1 NAME
5
6BarnOwl::Message::Facebook
7
8=head1 DESCRIPTION
9
10=cut
11
12package BarnOwl::Message::Facebook;
13use base qw(BarnOwl::Message);
14
15sub context { return shift->{"name"}; }
16sub subcontext { return shift->{"topic"}; }
17sub service { return "http://www.facebook.com"; }
18sub long_sender { return shift->{"permalink"}; }
19
20sub 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
30sub 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
481;
Note: See TracBrowser for help on using the repository browser.