aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-02-03 09:56:30 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-02-03 09:56:30 +0100
commit4bc5b9cf5f705600bdaacf439fb36737fb33729e (patch)
treea06c3206336404b96b42ec108a7c39f518035631
parent9d1cf8748923873da5e2c5df9d21a9976412a6b1 (diff)
telegram-chat: log warning only when trying to activate
-rw-r--r--telegram-chat7
1 files 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;
}
}
}