#!/usr/bin/perl $|++; $SIG{HUP} = \&Stop; $SIG{KILL} = \&Stop; $SIG{TERM} = \&Stop; $SIG{INT} = \&Stop; our $Connection = new Net::Jabber::Client(); $Connection->SetCallBacks(message=>\&InMessage, presence=>\&InPresence, iq=>\&InIQ); our $query3 = new Net::Jabber::Stanza("si");#falsch? $query3->SetStream(profile=>"http://jabber.org/protocol/si/profile/file-transfer");#falsch? our $status = $Connection->Connect(hostname=>'jabber.tf-network.de', port=>'5222', ); if (!(defined($status))){ print "ERROR: Jabber server is down or connection was not allowed.\n"; print " ($!)\n"; exit(0); } our @result = $Connection->AuthSend(username=>'myname', password=>'mypass', resource=>'pro'); if ($result[0] ne "ok"){ print "ERROR: Authorization failed: $result[0] - $result[1]\n"; exit(0); } print "Logged in to $server:$port...\n"; $Connection->RosterGet(); print "Getting Roster to tell server to send presence info...\n"; $Connection->PresenceSend(); print "Sending presence to tell world that we are logged in...\n"; while(defined($Connection->Process())) { } print "ERROR: The connection was killed...\n"; sub Stop{ print "Exiting...\n"; $Connection->Disconnect(); exit(0); } #noch diverse unwichtige Subroutinen um Nachrichten zu empfangen/senden