diff -u ?.2 --- a.2 2009-04-04 20:45:33.828027839 +0200 +++ b.2 2009-04-04 20:47:03.097072730 +0200 @@ -1,21 +1,22 @@ sub xmppconnect { + use constant USER => $xmppdata[0]; + use constant PASS => $xmppdata[1]; my $connection = Net::XMPP::Client->new(); - my $xmpp = getxmpp(); $connection->Connect( hostname => 'xmpp.quakelive.com') or die "Cannot connect ($!)\n"; - my @result = $connection->AuthSend( "username" => 'qlstats', "password" => $xmpp, "resource" => 'quakelive'); - if ($result[0] ne "ok") { + my @result = $connection->AuthSend( "username" => USER, "password" => PASS, "ressource" => 'quakelive'); + if (!defined($result[0])) { + print "Authed with XMPP server as user $xmppdata[0] with password $xmppdata[1]\n"; + } else { die "Ident/Auth with server failed: $result[0] - $result[1]\n"; } - -# $connection->PresenceSend(); - + $connection->PresenceSend(); my $message = Net::XMPP::Message->new(); $message->SetMessage( "to" => 'Mindfoo\@xmpp.quakelive.com', "type" => "chat", "body" => "testmsg from script"); $connection->Send($message) or die "Cant send msg!\n"; - sleep(2); + sleep(1); $connection->Disconnect(); }