1 package Thrasher
::Protocol
::Purple
::Yahoo
;
7 Thrasher::Protocol::Purple::Yahoo - protocol for connection to Yahoo
12 use base
"Thrasher::Protocol::Purple";
14 use Thrasher
::Log
qw(log debug);
15 #use CGI qw(escapeHTML);
22 my ($self, $jid, $registration_info) = @_;
24 my $username = $registration_info->{'username'} || '';
25 if ($username =~ /\@yahoo.com$/) {
26 # FIXME: Some sources suggest this won't work for all IDs with
27 # @yahoo.com emails, but our users seem to like it this way.
28 # We should really do this only as a fallback if Yahoo gives
29 # us a 1013 with the @yahoo.com username.
30 debug
("Suspiciously emailish Yahoo ID $username during registration.");
31 $registration_info->{'username'} =~ s/\@yahoo.com$//;
34 # If the username has trailing whitespace, the yahoo prpl starts
35 # an asynchronous connection and never comes back with either
36 # _connection or _connection_error! (reproducible in pidgin.)
38 # Note: Registering with a usernames with internal whitespace
39 # already returns an invalid username error.
40 $registration_info->{'username'} =~ s/^\s+|\s+$//g;
42 return $self->SUPER::registration
($jid, $registration_info);
45 # This receives the message we're about to send out, and adds any
46 # further processing that may be necessary.
52 # return escapeHTML($message);
55 #sub process_remote_username {
58 # $s =~ tr/[A-Z]/[a-z]/;
64 sub identifier
{ "yahoo" }
65 sub gateway_prompt
{ "Enter Yahoo Username:" }
66 sub gateway_desc
{ "Enter Yahoo Username:" }
72 # Valid id information based on the registration screen's messages.
73 return $id =~ /^[a-z][a-z_0-9]*(?:\.[a-z_0-9]*)?/i;