Codebase list sendxmpp / 2e4eaf7
Import Upstream version 1.18 Thadeu Lima de Souza Cascardo 6 years ago
1 changed file(s) with 11 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
1515 #
1616 # Released under the terms of the GNU General Public License v2
1717 #
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 $
1919 # $Id: $
2020
2121 use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed
4343 sub main();
4444
4545 my # MakeMaker
46 $VERSION = [ q$Revision: 1.15 $ =~ m/(\S+)\s*$/g ]->[0];
46 $VERSION = [ q$Revision: 1.18 $ =~ m/(\S+)\s*$/g ]->[0];
4747 my $RESOURCE = 'sendxmpp';
4848 my $VERBOSE = 0;
4949 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
5253
5354 # start!
5455 &main;
306307 connectiontype => 'tcpip',
307308 componentname => $comp
308309 };
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 {
311316 @res = $cnx->Connect(%$arghash);
312317 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;
316318 }
317319
318320 xmpp_check_result("Connect",\@res,$cnx);