From f4f83533b97a8cbf1cebc16c5a4f164ec3780895 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 May 2025 16:53:55 +0200 Subject: [PATCH 1/3] telegram-chat: support trusted group chat ids But be warned: Adding a person to a trusted group will give her/him administrative control over the device(s) - without changes on the device itself! --- telegram-chat.rsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 5bfa31c8..50fc0cce 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -107,7 +107,9 @@ :local ThreadId [ $IfThenElse ($Message->"is_topic_message") ($Message->"message_thread_id") "" ]; :foreach IdsTrusted in=($TelegramChatId, $TelegramChatIdsTrusted) do={ - :if ($From->"id" = $IdsTrusted || $From->"username" = $IdsTrusted) do={ + :if ($From->"id" = $IdsTrusted || \ + $From->"username" = $IdsTrusted || \ + $Chat->"id" = $IdsTrusted) do={ :set Trusted true; } } From cae5fdc341d26ed1898c09092af071e3972ba5f6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 May 2025 09:52:12 +0200 Subject: [PATCH 2/3] telegram-chat: support debug output for Updates in JSON --- telegram-chat.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 50fc0cce..277c40fc 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -33,6 +33,7 @@ :global GetRandom20CharAlNum; :global IfThenElse; :global LogPrint; + :global LogPrintVerbose; :global MAX; :global MIN; :global MkDir; @@ -96,6 +97,8 @@ :local Uptime [ /system/resource/get uptime ]; :foreach Update in=($JSON->"result") do={ :set UpdateID ($Update->"update_id"); + $LogPrintVerbose debug $ScriptName ("Update " . $UpdateID . ": " . [ :serialize to=json $Update ]); + :local Message ($Update->"message"); :local IsReply ([ :typeof ($Message->"reply_to_message") ] = "string"); :local IsMyReply ($TelegramMessageIDs->[ :tostr ($Message->"reply_to_message"->"message_id") ]); From b167a2daed50a3f159f6709eb51b29c2827561c7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 May 2025 10:02:03 +0200 Subject: [PATCH 3/3] DEBUG: fix typo --- DEBUG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEBUG.md b/DEBUG.md index d5e9beb7..66bf728a 100644 --- a/DEBUG.md +++ b/DEBUG.md @@ -42,7 +42,7 @@ Other actions (`disk`, `email`, `remote` or `support`) can be used as well. I do not recommend using `echo` - use [debug output](#debug-output) instead. -Disable or remote that setting to restore regular logging. +Disable or remove that setting to restore regular logging. ## Verbose output