Add support for type headline.

v0.6
Martin Dosch 1 year ago
parent c47fcef36a
commit fc515cc06f
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

@ -4,6 +4,8 @@
### Added
- Add support for sending Out of Band Data (OOB).
- Add SCRAM-SHA-1, SCRAM-SHA-256 and SCRAM-SHA512 support (via go-xmpp commit bef3e54).
- Add support for messages of type headline.
### Changed
- Print `--help` output to stdout instead of stderr.
- Print sent stanzas when `--debug` is used (via go-xmpp commit 9129a110df1b).

@ -75,12 +75,13 @@ If no configuration file is present or if the values should be overridden it is
the account details via command line options:
```plain
Usage: go-sendxmpp [-cdilnt] [-a value] [-f value] [--help] [-h value] [-j value] [-m value] [--muc-password value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [parameters ...]
Usage: go-sendxmpp [-cdilnt] [-a value] [-f value] [--headline] [--help] [-h value] [-j value] [-m value] [--muc-password value] [--oob-file value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [parameters ...]
-a, --alias=value Set alias/nicknamefor chatrooms.
-c, --chatroom Send message to a chatroom.
-d, --debug Show debugging info.
-f, --file=value Set configuration file. (Default:
~/.config/go-sendxmpp/sendxmpprc)
--headline Send message as type headline.
--help Show help.
-h, --http-upload=value
Send a file via http-upload.

@ -43,5 +43,6 @@ const (
strChat = "chat"
strError = "error"
strGroupchat = "groupchat"
strHeadline = "headline"
strResult = "result"
)

@ -123,6 +123,7 @@ func main() {
"Import an existing private OpenPGP key.")
flagOxDeleteNodes := getopt.BoolLong("ox-delete-nodes", 0, "Delete existing OpenPGP nodes on the server.")
flagOOBFile := getopt.StringLong("oob-file", 0, "", "URL to send a file as out of band data.")
flagHeadline := getopt.BoolLong("headline", 0, "Send message as type headline.")
// Parse command line flags.
getopt.Parse()
@ -151,6 +152,8 @@ func main() {
" http upload.")
case *flagOx && *flagOOBFile != "":
log.Fatal("No encryption possible for OOB data.")
case *flagHeadline && *flagChatroom:
log.Fatal("Can't use message type headline for groupchat messages.")
}
// Read recipients from command line and quit if none are specified.
@ -404,7 +407,11 @@ func main() {
}
var msgType string
msgType = strChat
if *flagHeadline {
msgType = strHeadline
} else {
msgType = strChat
}
if *flagChatroom {
msgType = strGroupchat
// Join the MUCs.

@ -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" "May 2023" ""
.TH "GO\-SENDXMPP" "1" "June 2023" ""
.SH "NAME"
\fBgo\-sendxmpp\fR \- A tool to send messages to an XMPP contact or MUC\.
.SH "SYNOPSIS"
@ -23,6 +23,9 @@ Show debugging info\.
\fB\-f\fR, \fB\-\-file\fR=[\fIvalue\fR]
Set configuration file\. (Default: ~/\.config/go\-sendxmpp/config)
.TP
\fB\-\-headline\fR
Send message as type headline\.
.TP
\fB\-\-help\fR
Show help\.
.TP

@ -106,6 +106,8 @@ file location is specified with <code>-f</code> or <code>--file</code>.</p>
<dt>
<code>-f</code>, <code>--file</code>=[<var>value</var>]</dt>
<dd>Set configuration file. (Default: ~/.config/go-sendxmpp/config)</dd>
<dt><code>--headline</code></dt>
<dd>Send message as type headline.</dd>
<dt><code>--help</code></dt>
<dd>Show help.</dd>
<dt>
@ -229,11 +231,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'>May 2023</li>
<li class='tc'>June 2023</li>
<li class='tr'>go-sendxmpp(1)</li>
</ol>

@ -28,6 +28,9 @@ Show debugging info.
* `-f`, `--file`=[<value>]:
Set configuration file. (Default: ~/.config/go-sendxmpp/config)
* `--headline`:
Send message as type headline.
* `--help`:
Show help.

Loading…
Cancel
Save