From 2e4eaf7ffb37745a7461a67f192de92aa492e4a9 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Fri, 11 Aug 2017 19:35:28 -0300 Subject: [PATCH] Import Upstream version 1.18 --- sendxmpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sendxmpp b/sendxmpp index 8df0042..d20f56b 100755 --- a/sendxmpp +++ b/sendxmpp @@ -16,7 +16,7 @@ if 0; # not running under some shell # # Released under the terms of the GNU General Public License v2 # -# $Platon: sendxmpp/sendxmpp,v 1.15 2008-10-21 21:31:53 rajo Exp $ +# $Platon: sendxmpp/sendxmpp,v 1.18 2009-01-10 11:40:14 rajo Exp $ # $Id: $ use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed @@ -44,12 +44,13 @@ sub terminate(); sub main(); my # MakeMaker -$VERSION = [ q$Revision: 1.15 $ =~ m/(\S+)\s*$/g ]->[0]; +$VERSION = [ q$Revision: 1.18 $ =~ m/(\S+)\s*$/g ]->[0]; my $RESOURCE = 'sendxmpp'; my $VERBOSE = 0; my $DEBUG = 0; -my @suppported_message_types = qw( message chat headline ); -my $message_type = 'message'; # default message type +# http://tools.ietf.org/html/rfc3921#section-2 section 2.1.1 - Types of Message +my @suppported_message_types = qw( chat error groupchat headline ); +my $message_type = 'chat'; # default message type # start! &main; @@ -307,13 +308,14 @@ sub xmpp_login ($$$$$$$$) { connectiontype => 'tcpip', componentname => $comp }; - $arghash->{port} = $port if (!$port); - if (!$port) { + + delete $arghash->{port} unless $port; + if ($arghash->{port}) { @res = $cnx->Connect(%$arghash); - error_exit ("Could not connect to server '$host': $@") unless @res; + error_exit ("Could not connect to '$host' on port $port: $@") unless @res; } else { @res = $cnx->Connect(%$arghash); - error_exit ("Could not connect to '$host' on port $port: $@") unless @res; + error_exit ("Could not connect to server '$host': $@") unless @res; } xmpp_check_result("Connect",\@res,$cnx); -- 2.20.1