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

release-1.10release-1.9
Last change on this file since 44f585c was eb497a9, 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
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"; }
18sub long_sender { return shift->{"zsig"}; } # XXX hack, shouldn't be named zsig
19
20sub replycmd {
21    my $self = shift;
22    # TODO: Support for direct messages
23    # XXX: It seems that Facebook may not support this yet
[eb497a9]24    return BarnOwl::quote('facebook-comment', $self->{post_id});
[24bd860]25}
26
27#sub replysendercmd {
28#    my $self = shift;
29#}
30
31sub smartfilter {
32    my $self = shift;
33    my $inst = shift;
34    my $filter;
[3d10ed3]35    # XXX I hope $filter isn't used for anything besides display purposes
[24bd860]36    if($inst) {
[eb497a9]37        $filter = "facebook: " . $self->{name} . " " . $self->{post_id};
[3d10ed3]38        BarnOwl::command("filter", $filter,
39                         qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$',
[eb497a9]40                         qw{and post_id}, '^'.$self->{post_id}.'$');
[3d10ed3]41    } else {
[24bd860]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
491;
Note: See TracBrowser for help on using the repository browser.