~mil/sxmo-devel

sxmo-utils: Allow user to block texts from numbers with block.tsv config file v2 APPLIED

Anjandev Momi: 1
 Allow user to block texts from numbers with block.tsv config file

 2 files changed, 13 insertions(+), 0 deletions(-)
#594394 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~mil/sxmo-devel/patches/25349/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH sxmo-utils v2] Allow user to block texts from numbers with block.tsv config file Export this patch

---
 scripts/core/sxmo_common.sh        | 4 ++++
 scripts/modem/sxmo_modemmonitor.sh | 9 +++++++++
 2 files changed, 13 insertions(+)

diff --git a/scripts/core/sxmo_common.sh b/scripts/core/sxmo_common.sh
index 7441231..8c5e773 100644
--- a/scripts/core/sxmo_common.sh
+++ b/scripts/core/sxmo_common.sh
@@ -28,10 +28,14 @@ export CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"/sxmo
# shellcheck disable=SC2034
export LOGDIR="${XDG_DATA_HOME:-$HOME/.local/share}"/sxmo/modem
# shellcheck disable=SC2034
export BLOCKDIR="${XDG_DATA_HOME:-$HOME/.local/share}"/sxmo/block
# shellcheck disable=SC2034
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
# shellcheck disable=SC2034
export CONTACTFILE="$XDG_CONFIG_HOME/sxmo/contacts.tsv"
# shellcheck disable=SC2034
export BLOCKFILE="$XDG_CONFIG_HOME/sxmo/block.tsv"
# shellcheck disable=SC2034
export UNSUSPENDREASONFILE="$XDG_RUNTIME_DIR/sxmo.suspend.reason"
# shellcheck disable=SC2034
export LASTSTATE="$XDG_RUNTIME_DIR/sxmo.suspend.laststate"
diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh
index 1446236..32cd7c9 100755
--- a/scripts/modem/sxmo_modemmonitor.sh
+++ b/scripts/modem/sxmo_modemmonitor.sh
@@ -196,6 +196,15 @@ checkfornewtexts() {
		NUM="$(cleanupnumber "$NUM")"
		TIME="$(echo "$TEXTDATA" | grep sms.properties.timestamp | sed -E 's/^sms\.properties\.timestamp\s+:\s+//')"

		if cut -f1 "$BLOCKFILE" | grep -q "^$NUM$"; then
			mkdir -p "$BLOCKDIR/$NUM"
			echo "sxmo_modemmonitor: BLOCKED text from number: $NUM (TEXTID: $TEXTID)">&2
			printf %b "Received from $NUM at $TIME:\n$TEXT\n\n" >> "$BLOCKDIR/$NUM/sms.txt"
			printf %b "$TIME\trecv_txt\t$NUM\t${#TEXT} chars\n" >> "$BLOCKDIR/modemlog.tsv"
			mmcli -m "$(modem_n)" --messaging-delete-sms="$TEXTID"
			continue
		fi

		mkdir -p "$LOGDIR/$NUM"
		echo "sxmo_modemmonitor: Text from number: $NUM (TEXTID: $TEXTID)">&2
		printf %b "Received from $NUM at $TIME:\n$TEXT\n\n" >> "$LOGDIR/$NUM/sms.txt"
-- 
2.32.0
builds.sr.ht
sxmo-utils/patches/.build.yml: SUCCESS in 25s

[Allow user to block texts from numbers with block.tsv config file][0] v2 from [Anjandev Momi][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/25349
[1]: mailto:anjan@momi.ca

✓ #594394 SUCCESS sxmo-utils/patches/.build.yml https://builds.sr.ht/~mil/job/594394
Applied!

--

Maarten van Gompel (proycon)
https://proycon.anaproy.nl