From 4bc5b9cf5f705600bdaacf439fb36737fb33729e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 3 Feb 2023 09:56:30 +0100 Subject: telegram-chat: log warning only when trying to activate --- telegram-chat | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/telegram-chat b/telegram-chat index 3d94221..d7b6f18 100644 --- a/telegram-chat +++ b/telegram-chat @@ -125,13 +125,16 @@ $WaitFullyConnected; } } } else={ - $LogPrintExit2 warning $0 ("Received a message from untrusted contact " . \ + :local Message ("Received a message from untrusted contact " . \ [ $IfThenElse ($FromUserName = false) "without username" ("'" . $FromUserName . "'") ] . \ - " (ID " . $FromID . ")!") false; + " (ID " . $FromID . ")!"); :if ($Text ~ ("^! *" . [ $EscapeForRegEx $Identity ] . "\$")) do={ + $LogPrintExit2 warning $0 $Message false; $SendTelegram2 ({ origin=$0; chatid=$ChatID; silent=false; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=("You are not trusted.") }); + } else={ + $LogPrintExit2 info $0 $Message false; } } } -- cgit v1.2.3-54-g00ecf