From 9d1cf8748923873da5e2c5df9d21a9976412a6b1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 3 Feb 2023 09:53:49 +0100 Subject: telegram-chat: handle missing username --- telegram-chat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telegram-chat b/telegram-chat index dffded1..3d94221 100644 --- a/telegram-chat +++ b/telegram-chat @@ -125,7 +125,9 @@ $WaitFullyConnected; } } } else={ - $LogPrintExit2 warning $0 ("Received a message from untrusted contact '" . $FromUserName . "' (ID " . $FromID . ")!") false; + $LogPrintExit2 warning $0 ("Received a message from untrusted contact " . \ + [ $IfThenElse ($FromUserName = false) "without username" ("'" . $FromUserName . "'") ] . \ + " (ID " . $FromID . ")!") false; :if ($Text ~ ("^! *" . [ $EscapeForRegEx $Identity ] . "\$")) do={ $SendTelegram2 ({ origin=$0; chatid=$ChatID; silent=false; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ -- cgit v1.2.3-54-g00ecf