line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Net::MSN::SB - SwitchBoard class for Net::MSN.
|
2
|
|
|
|
|
|
|
# Originally written by:
|
3
|
|
|
|
|
|
|
# Adam Swann - http://www.adamswann.com/library/2002/msn-perl/
|
4
|
|
|
|
|
|
|
# Modified by:
|
5
|
|
|
|
|
|
|
# David Radunz - http://www.boxen.net/
|
6
|
|
|
|
|
|
|
#
|
7
|
|
|
|
|
|
|
# $Id: SB.pm,v 1.3 2003/07/02 14:14:55 david Exp $
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Net::MSN::SB;
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
12
|
1
|
|
|
1
|
|
4
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
BEGIN {
|
15
|
1
|
|
|
1
|
|
4
|
use base 'Net::MSN::Base';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
541
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use vars qw($VERSION);
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$VERSION = do { my @r=(q$Revision: 1.3 $=~/\d+/g); sprintf "%d."."%03d"x$#r,@r };
|
20
|
|
|
|
|
|
|
}
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new {
|
23
|
|
|
|
|
|
|
my ($class, %args) = @_;
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my %defaults = (
|
26
|
|
|
|
|
|
|
_Type => 'SB'
|
27
|
|
|
|
|
|
|
);
|
28
|
|
|
|
|
|
|
my $self = __PACKAGE__->SUPER::new(
|
29
|
|
|
|
|
|
|
__PACKAGE__->SUPER::merge_opts(\%defaults, \%args)
|
30
|
|
|
|
|
|
|
);
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return $self;
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub sendmsg {
|
36
|
|
|
|
|
|
|
my ($self, $message, $type) = @_;
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$type = $type || 'N';
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $header = qq{MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nX-MMS-IM-Format: FN=MS%20Shell%20Dlg; EF=; CO=0; CS=0; PF=0\n\n};
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
$message = $header. $message;
|
43
|
|
|
|
|
|
|
$message =~ s/\n/\r\n/gs;
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$self->sendraw('MSG', $type. ' ' . length($message) . "\r\n" . $message);
|
46
|
|
|
|
|
|
|
}
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return 1;
|