Add support for groups

This commit is contained in:
Juraj Bednar 2024-11-17 14:43:11 +01:00
parent d85bcaecf0
commit d23062588a
2 changed files with 26 additions and 8 deletions

View File

@ -115,20 +115,31 @@ dependant on single infrastructure provider, anyone can run a node, but it is
highly secure. highly secure.
We can use [command-line version](https://github.com/simplex-chat/simplex-chat/blob/stable/docs/CLI.md). We can use [command-line version](https://github.com/simplex-chat/simplex-chat/blob/stable/docs/CLI.md).
After installation, you need to choose a display name and connect to profile After installation, you need to choose a display name and connect to a user or group
that should receive notifications (using /c command). After you are connected, that should receive notifications. Use the /c command to connect to a user, or the /g
write nickname into command to connect to a group. After you are connected, write the nickname or group name
into the configuration file, prefixing it with @ for users or # for groups:
``` ```
SIMPLEX_DESTINATION="nickname" SIMPLEX_DESTINATION="@nickname" # for users
```
or
```
SIMPLEX_DESTINATION="#groupname" # for groups
``` ```
If something does not work, the command that should work is: If something does not work, the command that should work for sending to a user is:
``` ```
simplex-chat -e '@nickname This is a test' -t 10 simplex-chat -e '@nickname This is a test' -t 10
``` ```
For sending to a group, use:
```
simplex-chat -e '#groupname This is a test' -t 10
```
## Why this project ## Why this project
I wanted to be able to perform a simple monitoring for my hosted server from I wanted to be able to perform a simple monitoring for my hosted server from

View File

@ -21,8 +21,15 @@ LXMF_NAME="LXMF bot signal-monitoring"
LXMF_PROPAGATION="32112312312312312312312312312312" LXMF_PROPAGATION="32112312312312312312312312312312"
### For simplex-chat command-line utility ### For simplex-chat command-line utility
# Nickname of already connected user (use /c) # Nickname of already connected user (use /c) or group (use /g)
SIMPLEX_DESTINATION="nickname" # Prefix user with @ and group with #
SIMPLEX_DESTINATION="@nickname"
# Time to wait for Simplex - this needs to be long enough to send the message to
# the relay. See: https://github.com/simplex-chat/simplex-chat/issues/5196
# The command is sent to background, so it won't block processing
SIMPLEX_WAIT=10
# now go to the notify function below, choose which notification mechanism # now go to the notify function below, choose which notification mechanism
# to use. # to use.
@ -50,7 +57,7 @@ function notify {
# LXMF / Reticulum / Sideband # LXMF / Reticulum / Sideband
#echo "$1" | LXMF-NotifyBot.py "${LXMF_DESTINATION}" "${LXMF_NAME}" "${LXMF_PROPAGATION}" > /dev/null #echo "$1" | LXMF-NotifyBot.py "${LXMF_DESTINATION}" "${LXMF_NAME}" "${LXMF_PROPAGATION}" > /dev/null
# SimpleX # SimpleX
#(simplex-chat -e "@${SIMPLEX_DESTINATION} ${1}" -t 10 > /dev/null) & #(simplex-chat -e "${SIMPLEX_DESTINATION} ${1}" -t ${SIMPLEX_WAIT} > /dev/null) &
log "Sending notification ${1}" log "Sending notification ${1}"
} }