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>, 11 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
RevLine 
[24bd860]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"}; }
[99f0a77]16sub subcontext { return shift->{"topic"}; }
[24bd860]17sub service { return "http://www.facebook.com"; }
[fb06a17]18sub long_sender { return shift->{"permalink"}; }
[24bd860]19
20sub replycmd {
21    my $self = shift;
[eb497a9]22    return BarnOwl::quote('facebook-comment', $self->{post_id});
[24bd860]23}
24
[fb06a17]25# XXX Messaging not supported yet.
[24bd860]26#sub replysendercmd {
27#    my $self = shift;
28#}
29
30sub smartfilter {
31    my $self = shift;
32    my $inst = shift;
33    my $filter;
[3d10ed3]34    # XXX I hope $filter isn't used for anything besides display purposes
[24bd860]35    if($inst) {
[eb497a9]36        $filter = "facebook: " . $self->{name} . " " . $self->{post_id};
[3d10ed3]37        BarnOwl::command("filter", $filter,
38                         qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$',
[eb497a9]39                         qw{and post_id}, '^'.$self->{post_id}.'$');
[3d10ed3]40    } else {
[24bd860]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.