Subject: | XML::Stream patch for support Google Talk w/ Net::XMPP |
Date: | Fri, 06 Oct 2006 15:32:49 +0900 |
To: | bug-XML-Stream [...] rt.cpan.org |
From: | "HIROSE, Masaaki" <hirose31 [...] t3.rim.or.jp> |
Hello,
Following patch is for connect Google Talk with Net::XMPP.
on Google Talk, server name (talk.google.com) and domain part of jid
(gmail.com) are different. But 'authname' must be not
"talk.google.com" but "gmail.com".
XML::Stream can get "gmail.com" via $self->{SIDS}->{$sid}->{to} which
is setted by "componentname" in Net::XMPP::Connection#Connect.
so this patch to use {$sid}->{to} if exists.
and we can connect Google Talk just like following code fragment.
my $xmpp = Net::XMPP::Client->new();
$xmpp->Connect(
hostname => 'talk.google.com',
tls => 1,
componentname => 'gmail.com',
);
Cheers,
--
HIROSE, Masaaki
-----------8<-----------8<-----------8<-----------8<-----------8<-----------
--- Stream.pm.orig 2004-08-25 23:23:32.000000000 +0900
+++ Stream.pm 2006-08-17 19:00:07.000000000 +0900
@@ -2113,7 +2113,7 @@
my $sasl = new Authen::SASL(mechanism=>join(" ",@{$mechanisms}),
callback=>{
- authname => $username."@".$self->{SIDS}->{$sid}->{hostname},
+ authname => $username."@".($self->{SIDS}->{$sid}->{to} or $self->{SIDS}->{$sid}->{hostname}),
user => $username,
pass => $password
-----------8<-----------8<-----------8<-----------8<-----------8<-----------