Leser: 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/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
2010-05-21T08:23:13 esskarfehlermeldungen?