~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] Allow user to block texts from numbers with block.tsv config file

Details
Message ID
<20210923034812.15355-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..b89a93f 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 grep -q "$NUM" "$BLOCKFILE"; 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
<CEGYHUR8XED4.EH3TTJQRMV52@cirno>
In-Reply-To
<20210923034812.15355-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] from [Anjandev Momi][1]

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

✓ #593851 SUCCESS sxmo-utils/patches/.build.yml https://builds.sr.ht/~mil/job/593851
Details
Message ID
<2BH0UTJZDBEJP.2RIV0XN5273BP@stacyharper.net>
In-Reply-To
<20210923034812.15355-1-anjan@momi.ca> (view parent)
DKIM signature
pass
Download raw message

Reply to thread Export thread (mbox)