Devicelist helper

This commit is contained in:
Bandie 2018-07-11 17:12:33 +02:00
parent 1dd4682029
commit c7c5e86b9e
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD
3 changed files with 38 additions and 5 deletions

View File

@ -1,5 +0,0 @@
all:
@printf "Nothing to make. Run \"make install\" instead.\n"
install:
install -D -m744 src/omemo-qrcode-gen "/usr/local/bin/omemo-qrcode-gen"

View File

@ -20,3 +20,11 @@ Example:
# This will put the string into stdout
./omemo-qrcode-gen bandie@example.com 9876543210 12345678 ABCDEF12 12345678 ABCDEF12 12345678 ABCDEF12 12345678 ABCDEF12 stdout
```
If you don't see your device ID's you can use `omemo-gen-get-devicelist-of` to copy paste it into an XMPP console.
it will be like
```console
# ./omemo-gen-get-devicelist-of <account you want to see the devicelist of>
```

30
src/omemo-gen-get-devicelist-of Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
CONFIG_DIR="$HOME/.config"
CONFIG="$CONFIG_DIR/jabberdevlistscript"
if ! [ -e "$CONFIG" ]; then
read -p "FROM is not set. Enter your Jabber ID: " FROM
mkdir -p $CONFIG_DIR
echo "FROM=$FROM" > $CONFIG
echo "If you want to change your FROM later, just edit or remove $CONFIG"
else
source $CONFIG
fi
if [ -z "$1" ]; then
echo "$0: Missing argument."
echo "Usage: $0 [ Jabber ID of wished device list ]"
echo "Config file: $CONFIG"
exit 1
fi
echo "$CONFIG loaded."
echo "
<iq type='get' from='$FROM' to='$1' id='fetch1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='eu.siacs.conversations.axolotl.devicelist'/>
</pubsub>
</iq>
"