Skip to content

Commit

Permalink
Add spaces after comma.
Browse files Browse the repository at this point in the history
  • Loading branch information
lhost committed Oct 7, 2014
1 parent f596346 commit 48f6fe8
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions sendxmpp
Expand Up @@ -102,7 +102,7 @@ sub main () { # {{{
$txt .= $_ while (<STDIN>);
}

xmpp_send ($cnx,$cmdline,$config,$txt);
xmpp_send ($cnx, $cmdline, $config, $txt);

}
else {
Expand All @@ -115,7 +115,7 @@ sub main () { # {{{
# line by line...
while (<STDIN>) {
chomp;
xmpp_send ($cnx,$cmdline,$config,$_);
xmpp_send ($cnx, $cmdline, $config, $_);
}
}

Expand All @@ -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;
Expand Down Expand Up @@ -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'");
}
}
Expand Down Expand Up @@ -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'");
}
}
Expand All @@ -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 ($$$$$$$$$$$$) { # {{{
Expand Down Expand Up @@ -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};
Expand All @@ -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;
} # }}}
Expand Down Expand Up @@ -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 ($$$$$$) { # {{{

Expand All @@ -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;
Expand All @@ -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);
} # }}}

#
Expand All @@ -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
} # }}}

#
Expand All @@ -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);
}
} # }}}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -594,87 +594,87 @@ unlike L<mail(1)>. Messages can be sent both to individual recipients and chatro
=over
=item B<-f>,B<--file> I<file>
=item B<-f>, B<--file> I<file>
Use I<file> configuration file instead of F<~/.sendxmpprc>
=item B<-u>,B<--username> I<user>
=item B<-u>, B<--username> I<user>
Use I<user> instead of the one in the configuration file
=item B<-p>,B<--password> I<password>
=item B<-p>, B<--password> I<password>
Use I<password> instead of the one in the configuration file
=item B<--sso>
Instead of specifying username or password, attempt to use system level SSO (e.g. kerberos) if supported.
=item B<-j>,B<--jserver> I<server>
=item B<-j>, B<--jserver> I<server>
Use jabber I<server> instead of the one in the configuration file.
=item B<-o>,B<--component> I<componentname>
=item B<-o>, B<--component> I<componentname>
Use componentname in connect call. Seems needed for Google talk.
=item B<-r>,B<--resource> I<res>
=item B<-r>, B<--resource> I<res>
Use resource I<res> 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)
=item B<--messages-type>
Set type of message. Supported types are: B<message chat headline>. Default message type is B<message>. 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<subject>
=item B<-s>, B<--subject> I<subject>
Set the subject for the message to I<subject> [default: '']; when sending to a chatroom, this will set the subject for the chatroom
=item B<-m>,B<--message> I<message>
=item B<-m>, B<--message> I<message>
Read the message from I<message> (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<WARNING>: This will include passwords etc. so be careful with the output! Specify multiple times to increase debug level.
Expand Down

0 comments on commit 48f6fe8

Please sign in to comment.