Change default resource

Use "go-sendxmpp" plus a random string
(e.g. "go-sendxmpp.aafeec4c-3136ee04-06ab90a)
instead of only "go-sendxmpp" to prevent conflicts
if two instances run at the same time without
having a custom resource configured.
This commit is contained in:
Martin Dosch 2021-07-02 10:55:03 +02:00
parent 1382d06180
commit c10213493b
5 changed files with 10 additions and 10 deletions

View File

@ -77,7 +77,7 @@ the account details via command line options:
--raw Send raw XML
-r, --resource=value
Set resource. When sending to a chatroom this is used as
'alias'. (Default: go-sendxmpp) [go-sendxmpp]
'alias'.
-t, --tls Use direct TLS.
-u, --username=value
Username for XMPP account.

View File

@ -227,7 +227,7 @@ func main() {
flagTLS := getopt.BoolLong("tls", 't', "Use direct TLS.")
flagStartTLS := getopt.BoolLong("start-tls", 'x', "Use StartTLS. (DEPRECATED)")
flagResource := getopt.StringLong("resource", 'r', "", "Set resource. "+
"When sending to a chatroom this is used as 'alias'. (Default: go-sendxmpp)")
"When sending to a chatroom this is used as 'alias'.")
flagFile := getopt.StringLong("file", 'f', "", "Set configuration file. (Default: "+
"~/.config/go-sendxmpp/sendxmpprc)")
flagMessageFile := getopt.StringLong("message", 'm', "", "Set file including the message.")
@ -303,8 +303,8 @@ func main() {
if *flagResource != "" {
resource = *flagResource
} else if resource == "" {
// Use "go-sendxmpp" if no other resource is specified
resource = "go-sendxmpp"
// Use "go-sendxmpp" plus a random string if no other resource is specified
resource = "go-sendxmpp." + getID()
}
if (*flagHttpUpload != "") && (*flagInteractive || (*flagMessageFile != "")) {

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "GO\-SENDXMPP" "1" "March 2021" ""
.TH "GO\-SENDXMPP" "1" "July 2021" ""
.SH "NAME"
\fBgo\-sendxmpp\fR \- A little tool to send messages to an XMPP contact or MUC\.
.SH "SYNOPSIS"
@ -45,7 +45,7 @@ Password for XMPP account\.
Send raw XML\. To send raw XML to a contact as normal chat message no contact must be specified\. To send raw XML to a MUC you have to specify the MUC via \fB\-c\fR and \fBgo\-sendxmpp\fR will join the MUC\.
.TP
\fB\-r\fR, \fB\-\-resource\fR=[\fIvalue\fR]
Set resource\. When sending to a chatroom this is used as 'alias'\. (Default: go\-sendxmpp)
Set resource\. When sending to a chatroom this is used as 'alias'\.
.TP
\fB\-t\fR, \fB\-\-tls\fR
Use direct TLS\.

View File

@ -130,7 +130,7 @@ To send raw XML to a MUC you have to specify the MUC via <code>-c</code> and <co
<dt>
<code>-r</code>, <code>--resource</code>=[<var>value</var>]</dt>
<dd>Set resource. When sending to a chatroom this is used as
'alias'. (Default: go-sendxmpp)</dd>
'alias'.</dd>
<dt>
<code>-t</code>, <code>--tls</code>
</dt>
@ -165,11 +165,11 @@ License: BSD 2-clause License</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<p><a class="man-ref" href="go-sendxmpp.5.html">go-sendxmpp<span class="s">(5)</span></a>, <span class="man-ref">sendxmpp<span class="s">(1)</span></span></p>
<p><span class="man-ref">go-sendxmpp<span class="s">(5)</span></span>, <span class="man-ref">sendxmpp<span class="s">(1)</span></span></p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>March 2021</li>
<li class='tc'>July 2021</li>
<li class='tr'>go-sendxmpp(1)</li>
</ol>

View File

@ -52,7 +52,7 @@ To send raw XML to a MUC you have to specify the MUC via `-c` and `go-sendxmpp`
* `-r`, `--resource`=[<value>]:
Set resource. When sending to a chatroom this is used as
'alias'. (Default: go-sendxmpp)
'alias'.
* `-t`, `--tls`:
Use direct TLS.