Import Upstream version 1.18
Thadeu Lima de Souza Cascardo
6 years ago
15 | 15 | # |
16 | 16 | # Released under the terms of the GNU General Public License v2 |
17 | 17 | # |
18 | # $Platon: sendxmpp/sendxmpp,v 1.15 2008-10-21 21:31:53 rajo Exp $ | |
18 | # $Platon: sendxmpp/sendxmpp,v 1.18 2009-01-10 11:40:14 rajo Exp $ | |
19 | 19 | # $Id: $ |
20 | 20 | |
21 | 21 | use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed |
43 | 43 | sub main(); |
44 | 44 | |
45 | 45 | my # MakeMaker |
46 | $VERSION = [ q$Revision: 1.15 $ =~ m/(\S+)\s*$/g ]->[0]; | |
46 | $VERSION = [ q$Revision: 1.18 $ =~ m/(\S+)\s*$/g ]->[0]; | |
47 | 47 | my $RESOURCE = 'sendxmpp'; |
48 | 48 | my $VERBOSE = 0; |
49 | 49 | my $DEBUG = 0; |
50 | my @suppported_message_types = qw( message chat headline ); | |
51 | my $message_type = 'message'; # default message type | |
50 | # http://tools.ietf.org/html/rfc3921#section-2 section 2.1.1 - Types of Message | |
51 | my @suppported_message_types = qw( chat error groupchat headline ); | |
52 | my $message_type = 'chat'; # default message type | |
52 | 53 | |
53 | 54 | # start! |
54 | 55 | &main; |
306 | 307 | connectiontype => 'tcpip', |
307 | 308 | componentname => $comp |
308 | 309 | }; |
309 | $arghash->{port} = $port if (!$port); | |
310 | if (!$port) { | |
310 | ||
311 | delete $arghash->{port} unless $port; | |
312 | if ($arghash->{port}) { | |
313 | @res = $cnx->Connect(%$arghash); | |
314 | error_exit ("Could not connect to '$host' on port $port: $@") unless @res; | |
315 | } else { | |
311 | 316 | @res = $cnx->Connect(%$arghash); |
312 | 317 | error_exit ("Could not connect to server '$host': $@") unless @res; |
313 | } else { | |
314 | @res = $cnx->Connect(%$arghash); | |
315 | error_exit ("Could not connect to '$host' on port $port: $@") unless @res; | |
316 | 318 | } |
317 | 319 | |
318 | 320 | xmpp_check_result("Connect",\@res,$cnx); |