MSN prpl lacks a status type for the EXTENDED_AWAY primitive.
[thrasher.git] / perl / lib / Thrasher / Protocol / Purple / MSN.pm
blob74d40521d050fd0ebdb908e1ac6b0d96686d4a91
1 package Thrasher::Protocol::Purple::MSN;
2 use strict;
3 use warnings;
5 =head1 NAME
7 Thrasher::Protocol::Purple::MSN - protocol for connection to Windows
8 Live Messenger, or whatever they're calling it this week.
10 =cut
12 use base "Thrasher::Protocol::Purple";
14 use Thrasher::Log qw(log debug);
15 use Thrasher::Protocol::Purple::Vars qw(%purple_presence);
17 sub prpl {
18 return "prpl-msn";
21 sub process_outgoing_purple_status {
22 my ($self, $session, $type, $show, $message, $purple_status) = @_;
24 if ($purple_status == $purple_presence{'xaway'}) {
25 # MSN prpl lacks a status type for the EXTENDED_AWAY primitive.
26 $purple_status = $purple_presence{'away'};
29 return ($message, $purple_status);
32 sub fake_up_a_legacy_name {
33 my ($self, $user_jid, $jid, $legacy_guess) = @_;
35 if ($legacy_guess !~ /@/) {
36 # Avoid discombobulation: msn_normalize adds @hotmail.com, but
37 # only after some things are set up w/o it (e.g. name_maps).
38 $legacy_guess .= '@hotmail.com';
41 return $legacy_guess;
44 sub name { "MSN" }
45 sub identifier { "msn" }
46 sub gateway_prompt { "Enter MSN Username:" }
47 sub gateway_desc { "Enter MSN Username:" }
49 sub ft_local_ready {
50 my ($self, $id) = @_;
51 # no op--MSN prpl uses its own loop which ft.c do_transfer interferes with.
52 return 0; # don't repeat this notification.