~mil/sxmo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

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

Details
Message ID
<20210923175751.12241-1-anjan@momi.ca>
DKIM signature
pass
Download raw message
Patch: +13 -0
---
 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

[sxmo-utils/patches/.build.yml] build success

builds.sr.ht
Details
Message ID
<CEHGSAW7WQGX.3DCVCNT22RYS5@cirno>
In-Reply-To
<20210923175751.12241-1-anjan@momi.ca> (view parent)
DKIM signature
missing
Download raw message
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]: anjan@momi.ca

✓ #594394 SUCCESS sxmo-utils/patches/.build.yml https://builds.sr.ht/~mil/job/594394
Details
Message ID
<20211008200741.q3vxova6yjlqpzes@worker.anaproy.lxd>
In-Reply-To
<20210923175751.12241-1-anjan@momi.ca> (view parent)
DKIM signature
missing
Download raw message
Applied!

--

Maarten van Gompel (proycon)
https://proycon.anaproy.nl
Reply to thread Export thread (mbox)