#
# 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
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;
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);