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 return $self->SUPER::registration
($jid, $registration_info);
37 # This receives the message we're about to send out, and adds any
38 # further processing that may be necessary.
44 # return escapeHTML($message);
47 #sub process_remote_username {
50 # $s =~ tr/[A-Z]/[a-z]/;
56 sub identifier
{ "yahoo" }
57 sub gateway_prompt
{ "Enter Yahoo Username:" }
58 sub gateway_desc
{ "Enter Yahoo Username:" }
64 # Valid id information based on the registration screen's messages.
65 return $id =~ /^[a-z][a-z_0-9]*(?:\.[a-z_0-9]*)?/i;