From 48f6fe83589b04b77dd4fe52b810f1415aa2835c Mon Sep 17 00:00:00 2001 From: Lubomir Host Date: Tue, 7 Oct 2014 19:38:00 +0200 Subject: [PATCH] Add spaces after comma. --- sendxmpp | 78 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/sendxmpp b/sendxmpp index 91ae1ef..74d95c0 100755 --- a/sendxmpp +++ b/sendxmpp @@ -102,7 +102,7 @@ sub main () { # {{{ $txt .= $_ while (); } - xmpp_send ($cnx,$cmdline,$config,$txt); + xmpp_send ($cnx, $cmdline, $config, $txt); } else { @@ -115,7 +115,7 @@ sub main () { # {{{ # line by line... while () { chomp; - xmpp_send ($cnx,$cmdline,$config,$_); + xmpp_send ($cnx, $cmdline, $config, $_); } } @@ -141,7 +141,7 @@ sub read_config_file ($) { # {{{ error_exit ("$cfg_file must not be accessible by others") if ($mode & 0077); - open (CFG,"<$cfg_file") + open (CFG, "<$cfg_file") or error_exit("cannot open $cfg_file for reading: $!"); my %config; @@ -193,7 +193,7 @@ sub read_config_file ($) { # {{{ unless (scalar(%config)); if ($DEBUG || $VERBOSE) { - while (my ($key,$val) = each %config) { + while (my ($key, $val) = each %config) { debug_print ("config: '$key' => '$val'"); } } @@ -309,7 +309,7 @@ sub parse_cmdline () { # {{{ ); if ($DEBUG || $VERBOSE) { - while (my ($key,$val) = each %dict) { + while (my ($key, $val) = each %dict) { debug_print ("cmdline: '$key' => '$val'"); } } @@ -319,7 +319,7 @@ sub parse_cmdline () { # {{{ # # xmpp_login: login to the xmpp (jabber) server -# input: hostname,port,username,password,resource,tls,ssl,debug +# input: hostname, port, username, password, resource, tls, ssl, debug # output: an XMPP connection object # sub xmpp_login ($$$$$$$$$$$$) { # {{{ @@ -374,7 +374,7 @@ sub xmpp_login ($$$$$$$$$$$$) { # {{{ error_exit ("Could not connect to server '$host': ".($cnx->GetErrorCode()||$@)) unless @res; } - xmpp_check_result("Connect",\@res,$cnx); + xmpp_check_result("Connect", \@res, $cnx); if ($comp) { my $sid = $cnx->{SESSION}->{id}; @@ -385,7 +385,7 @@ sub xmpp_login ($$$$$$$$$$$$) { # {{{ 'username' => $user, 'password' => $pw, 'resource' => $res); - xmpp_check_result('AuthSend',\@res,$cnx); + xmpp_check_result('AuthSend', \@res, $cnx); return $cnx; } # }}} @@ -426,20 +426,20 @@ sub xmpp_send ($$$$) { # {{{ # # xmpp_send_raw_xml: send a raw XML packet -# input: connection,packet +# input: connection, packet # sub xmpp_send_raw_xml ($$) { # {{{ - my ($cnx,$packet) = @_; + my ($cnx, $packet) = @_; # for some reason, Send does not return anything $cnx->Send($packet); - xmpp_check_result('Send',0,$cnx); + xmpp_check_result('Send', 0, $cnx); } # }}} # # xmpp_send_message: send a message to some xmpp user -# input: connection,recipient,subject,msg +# input: connection, recipient, subject, msg # sub xmpp_send_message ($$$$$$) { # {{{ @@ -452,16 +452,16 @@ sub xmpp_send_message ($$$$$$) { # {{{ 'subject' => $subject, 'body' => $msg); - xmpp_check_result('MessageSend',0,$cnx); + xmpp_check_result('MessageSend', 0, $cnx); } # }}} # # xmpp_send_chatroom_message: send a message to a chatroom -# input: connection,resource,subject,recipient,message +# input: connection, resource, subject, recipient, message # sub xmpp_send_chatroom_message ($$$$$) { # {{{ - my ($cnx,$resource,$subject,$rcpt,$msg) = @_; + my ($cnx, $resource, $subject, $rcpt, $msg) = @_; # set the presence my $pres = new Net::XMPP::Presence; @@ -476,10 +476,10 @@ sub xmpp_send_chatroom_message ($$$$$) { # {{{ type => 'groupchat'); $res = $cnx->Send($groupmsg); - xmpp_check_result ('Send',$res,$cnx); + xmpp_check_result ('Send', $res, $cnx); # leave the group - $pres->SetPresence (Type=>'unavailable',To=>$rcpt); + $pres->SetPresence (Type=>'unavailable', To=>$rcpt); } # }}} # @@ -494,7 +494,7 @@ sub xmpp_logout($) { # {{{ my $cnx = shift; $cnx->Disconnect(); - xmpp_check_result ('Disconnect',0); # well, nothing to check, really + xmpp_check_result ('Disconnect', 0); # well, nothing to check, really } # }}} # @@ -518,7 +518,7 @@ sub xmpp_check_result { # {{{ } else { my $errmsg = $cnx->GetErrorCode() || '?'; - error_exit ("Error '$txt': " . join (': ',@$res) . "[$errmsg]", $cnx); + error_exit ("Error '$txt': " . join (': ', @$res) . "[$errmsg]", $cnx); } } # }}} @@ -547,7 +547,7 @@ sub debug_print { # {{{ # sub error_exit { # {{{ - my ($err,$cnx) = @_; + my ($err, $cnx) = @_; print STDERR "$err\n"; xmpp_logout ($cnx) if ($cnx); @@ -594,15 +594,15 @@ unlike L. Messages can be sent both to individual recipients and chatro =over -=item B<-f>,B<--file> I +=item B<-f>, B<--file> I Use I configuration file instead of F<~/.sendxmpprc> -=item B<-u>,B<--username> I +=item B<-u>, B<--username> I Use I instead of the one in the configuration file -=item B<-p>,B<--password> I +=item B<-p>, B<--password> I Use I instead of the one in the configuration file @@ -610,35 +610,35 @@ Use I instead of the one in the configuration file Instead of specifying username or password, attempt to use system level SSO (e.g. kerberos) if supported. -=item B<-j>,B<--jserver> I +=item B<-j>, B<--jserver> I Use jabber I instead of the one in the configuration file. -=item B<-o>,B<--component> I +=item B<-o>, B<--component> I Use componentname in connect call. Seems needed for Google talk. -=item B<-r>,B<--resource> I +=item B<-r>, B<--resource> I Use resource I for the sender [default: 'sendxmpp']; when sending to a chatroom, this determines the 'alias' -=item B<-t>,B<--tls> +=item B<-t>, B<--tls> Connect securely, using TLS -=item B<-e>,B<--ssl> +=item B<-e>, B<--ssl> Connect securely, using SSL -=item B<-n>,B<--no-tls-verify> +=item B<-n>, B<--no-tls-verify> Deactivate the verification of SSL certificates. Better way is to use parameter B<--tls-ca-path> with the needed path to CA certificates. -=item B<-a>,B<--tls-ca-path> +=item B<-a>, B<--tls-ca-path> Path to your custom CA certificates, so you can verificate SSL certificates during connecting. -=item B<-l>,B<--headline> +=item B<-l>, B<--headline> Backward compatibility option. You should use B<--message-type=headline> instead. Send a headline type message (not stored in offline messages) @@ -646,35 +646,35 @@ Backward compatibility option. You should use B<--message-type=headline> instead Set type of message. Supported types are: B. Default message type is B. Headline type message can be set also with B<--headline> option, see B<--headline> -=item B<-c>,B<--chatroom> +=item B<-c>, B<--chatroom> Send the message to a chatroom -=item B<-s>,B<--subject> I +=item B<-s>, B<--subject> I Set the subject for the message to I [default: '']; when sending to a chatroom, this will set the subject for the chatroom -=item B<-m>,B<--message> I +=item B<-m>, B<--message> I Read the message from I (a file) instead of stdin -=item B<-i>,B<--interactive> +=item B<-i>, B<--interactive> Work in interactive mode, reading lines from stdin and sending the one-at-time -=item B<-w>,B<--raw> +=item B<-w>, B<--raw> Send raw XML message to jabber server -=item B<-v>,B<--verbose> +=item B<-v>, B<--verbose> Give verbose output about what is happening -=item B<-h>,B<--help>,B<--usage> +=item B<-h>, B<--help>, B<--usage> Show a 'Usage' message -=item B<-d>,B<--debug> +=item B<-d>, B<--debug> Show debugging info while running. B: This will include passwords etc. so be careful with the output! Specify multiple times to increase debug level.