This commit is contained in:
DebXWoody 2020-04-24 20:45:23 +02:00
parent 7f5fc6ed86
commit db24e0250c
No known key found for this signature in database
GPG Key ID: C2DC916F35751C24
2 changed files with 49 additions and 52 deletions

View File

@ -23,28 +23,6 @@ aptitude install libstrophe-dev
make make
``` ```
## Usage
```
xmppc --jid user@domain.tld --pwd "password" --mode roster list
xmppc -j user@domain.tld -p "password" -m roster list
xmppc -j user@domain.tld -p "password" -m roster export
xmppc -j user@domain.tld -p "password" -m message chat friend@domain.tld "Message"
xmppc -j user@domain.tld -p "password" -m pgp chat friend@domain.tld "Message"
xmppc -j user@domain.tld -p "password" -m openpgp signcrypt friend@domain.tld "Message"
xmppc -j user@domain.tld -p "password" -m omemo list
xmppc -j user@domain.tld -p "password" -m monitor stanza
xmppc -a alice -m mam list bob@domain.tld
xmppc -m bookmark list
xmppc -m discovery info domain.tld
xmppc -m discovery item conference.domain.tld
```
Use xmppc with [pass](https://packages.debian.org/buster/pass)
```
xmppc --jid user@domain.tld --pwd $(pass XMPP/domain.tld/user) --mode roster list
```
## Config file ## Config file
Config file: ` ~/.config/xmppc.conf` Config file: ` ~/.config/xmppc.conf`
@ -59,11 +37,19 @@ jid=account1@domain.tld
pwd=YourSecret pwd=YourSecret
``` ```
## Usage
```
xmppc --jid user@domain.tld --pwd "password" --mode roster list
xmppc -j user@domain.tld -p "password" -m roster list
xmppc -a alice -m mam list bob@domain.tld
xmppc -m bookmark list
xmppc -h
```
More command and information see: [Wiki](https://codeberg.org/Anoxinon_e.V./xmppc/wiki)
## Documentation ## Documentation
* [Wiki](https://codeberg.org/Anoxinon_e.V./xmppc/wiki) * [Wiki](https://codeberg.org/Anoxinon_e.V./xmppc/wiki)
## Contact details
* MUC: [xmpp:xmpp-messenger@conference.anoxinon.me?join](xmpp:xmpp-messenger@conference.anoxinon.me?join)

View File

@ -293,15 +293,15 @@ void conn_handler(xmpp_conn_t *const conn, const xmpp_conn_event_t status,
return; return;
} }
switch (status) {
case XMPP_CONN_CONNECT:
logInfo(callback->xmppc, "Connected\n");
if( xmpp_conn_is_secured(conn) ) { if( xmpp_conn_is_secured(conn) ) {
logInfo(callback->xmppc, "Secure connection!\n"); logInfo(callback->xmppc, "Secure connection!\n");
} else { } else {
logWarn(callback->xmppc, "Connection not secure!\n"); logWarn(callback->xmppc, "Connection not secure!\n");
} }
switch (status) {
case XMPP_CONN_CONNECT:
logInfo(callback->xmppc, "Connected\n");
callback->callback(callback->xmppc, callback->argc, callback->argv); callback->callback(callback->xmppc, callback->argc, callback->argv);
break; break;
case XMPP_CONN_RAW_CONNECT: case XMPP_CONN_RAW_CONNECT:
@ -487,12 +487,12 @@ static void _show_help() {
#else #else
printf("%s\n", PACKAGE_STRING); printf("%s\n", PACKAGE_STRING);
#endif #endif
printf("Usage: xmppc --account <account> --jid <jid> --pwd <pwd> --mode <mode> <command> <parameters>\n"); printf("Usage: xmppc [--account <account>] [ --jid <jid> --pwd <pwd>] --mode <mode> <command> [<parameters> ...]\n");
printf("Options:\n"); printf("Options:\n");
printf(" -h / --help Display this information.\n"); printf(" -h / --help Display this information.\n");
printf(" -j / --jid <jid> Jabber ID\n"); printf(" -j / --jid <jid> Jabber ID\n");
printf(" -p / --pwd <password> Passwort\n"); printf(" -p / --pwd <password> Passwort\n");
printf(" -a / --account <account> Passwort\n"); printf(" -a / --account <account> Account\n");
printf(" -m / --mode <mode> xmppc mode\n"); printf(" -m / --mode <mode> xmppc mode\n");
printf("\n"); printf("\n");
printf("Modes:\n"); printf("Modes:\n");
@ -506,19 +506,30 @@ static void _show_help() {
printf(" -m --mode pgp xmppc pgp mode (XEP-0027) \n"); printf(" -m --mode pgp xmppc pgp mode (XEP-0027) \n");
printf(" chat <jid> <message> Sending pgp encrypted message to jid\n"); printf(" chat <jid> <message> Sending pgp encrypted message to jid\n");
printf("\n"); printf("\n");
printf(" -m --mode omemo xmppc omemo mode\n"); printf(" -m --mode omemo xmppc omemo mode (XEP-0384)\n");
printf(" list List the device IDs and fingerprints\n"); printf(" list List the device IDs and fingerprints\n");
printf("\n"); printf("\n");
printf(" -m --mode openpgp xmppc openpgp mode (XEP-0373)\n"); printf(" -m --mode openpgp xmppc openpgp mode (XEP-0373)\n");
printf(" signcrypt <jid> <message> Sending pgp signed and encrypted message to jid\n"); printf(" signcrypt <jid> <message> Sending pgp signed and encrypted message to jid\n");
printf("\n"); printf("\n");
printf(" -m --mode monitor Monitot mode"); printf(" -m --mode monitor Monitot mode\n");
printf(" stanza Stanza Monitor\n"); printf(" stanza Stanza Monitor\n");
printf(" monitor microblog Monitor microblog (XEP-0277: Microblogging over XMPP)\n"); printf(" monitor microblog Monitor microblog (XEP-0277)\n");
printf("\n");
printf(" -m --mode bookmark Bookmark mode (XEP-0048)\n");
printf(" list List bookmarks\n");
printf("\n");
printf(" -m --mode mam Message Archive Management (XEP-0313)\n");
printf(" list <jid> List messages from <jid>\n");
printf("\n");
printf(" -m --mode discovery Service Discovery (XEP-0030)\n");
printf(" info <jid> info request for <jid>\n");
printf(" item <jid> item request for <jid>\n");
printf("\n"); printf("\n");
printf("\n"); printf("\n");
printf("Examples:\n"); printf("Examples:\n");
printf(" Usage: xmppc --jid user@domain.tld --pwd \"secret\" --mode roster list\n"); printf(" Usage: xmppc --jid user@domain.tld --pwd \"secret\" --mode roster list\n");
printf(" Usage: xmppc --jid user@domain.tld --pwd \"secret\" --mode pgp chat friend@domain.tld \"Hello\"\n"); printf(" Usage: xmppc --jid user@domain.tld --pwd \"secret\" --mode pgp chat friend@domain.tld \"Hello\"\n");
printf(" Usage: xmppc -a account1 --mode discovery item conference@domain.tld\n");
printf(" Usage: xmppc --mode bookmark list\n");
} }