| 1 | package Net::YahooMessenger::SendMessage; | ||
| 2 | use base 'Net::YahooMessenger::Event'; | ||
| 3 | |||
| 4 | use constant YMSG_SEPARATOR => "\xC0\x80"; | ||
| 5 | |||
| 6 | sub code { | ||
| 7 | return 6; | ||
| 8 | } | ||
| 9 | |||
| 10 | sub body { | ||
| 11 | my ( $self, $message ) = @_; | ||
| 12 | if ( defined $message ) { | ||
| 13 | $message .= | ||
| 14 | YMSG_SEPARATOR . '63' | ||
| 15 | . YMSG_SEPARATOR . ';0' | ||
| 16 | . YMSG_SEPARATOR . '64' | ||
| 17 | . YMSG_SEPARATOR . '0' | ||
| 18 | . YMSG_SEPARATOR . '1002' | ||
| 19 | . YMSG_SEPARATOR . '1' | ||
| 20 | . YMSG_SEPARATOR . '206' | ||
| 21 | . YMSG_SEPARATOR . '0'; | ||
| 22 | } | ||
| 23 | return $self->SUPER::body($message); | ||
| 24 | } | ||
| 25 | |||
| 26 | sub to { | ||
| 27 | my ( $self, $to ) = @_; | ||
| 28 | |||
| 29 | if ( defined $to ) { | ||
| 30 | $to .= YMSG_SEPARATOR . '97' . YMSG_SEPARATOR . '1'; | ||
| 31 | } | ||
| 32 | |||
| 33 | return $self->SUPER::to($to); | ||
| 34 | |||
| 35 | } | ||
| 36 | |||
| 37 | sub to_string { | ||
| 38 | my $self = shift; | ||
| 39 | sprintf "%s: %s", $self->{sender}, $self->{body}; | ||
| 40 | |||
| 41 | } | ||
| 42 | 1; | ||
| 43 | __END__ |