From 820e4aee5dd6dd8f7abbe7213e17b79c1fb441b6 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Fri, 11 Aug 2017 19:35:29 -0300 Subject: [PATCH] Import Upstream version 1.22 --- sendxmpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sendxmpp b/sendxmpp index 4a86f6e..b78fbc2 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.20 2010-01-18 00:54:16 rajo Exp $ +# $Platon: sendxmpp/sendxmpp,v 1.22 2010-10-03 19:36:35 rajo Exp $ # $Id: $ use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed @@ -44,7 +44,7 @@ sub terminate(); sub main(); my # MakeMaker -$VERSION = [ q$Revision: 1.20 $ =~ m/(\S+)\s*$/g ]->[0]; +$VERSION = [ q$Revision: 1.22 $ =~ m/(\S+)\s*$/g ]->[0]; my $RESOURCE = 'sendxmpp'; my $VERBOSE = 0; my $DEBUG = 0; @@ -178,7 +178,7 @@ sub read_config_file ($) { # account with specific connection host if ($config{'jserver'} =~ /(.*);([-\.\w]+)/) { $config{'jserver'} = $2; - $config{'username'} .= "\@$1"; + $config{'username'} .= "\@$1" unless $config{'component'}; } } @@ -405,7 +405,8 @@ sub xmpp_send_message ($$$$$$) { my ($cnx, $rcpt, $comp, $subject, $message_type, $msg) = @_; # for some reason, MessageSend does not return anything - $cnx->MessageSend('to' => $rcpt . ( $comp ? "\@$comp" : '' ), + # mimeit01@xmpp.hs-esslingen.de: if $comp IS set, AND the rcpt DOESN'T contain an @, then @comp is added + $cnx->MessageSend('to' => $rcpt . ( ($comp && index($rcpt, "@") == -1) ? "\@$comp" : '' ), 'type' => $message_type, 'subject' => $subject, 'body' => $msg); -- 2.20.1