diff options
author | Christian Hesse <mail@eworm.de> | 2023-02-03 09:53:49 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-02-03 09:53:49 +0100 |
commit | 9d1cf8748923873da5e2c5df9d21a9976412a6b1 (patch) | |
tree | 7fc8786270becf51036f095f899ad10237fc0ce0 | |
parent | 490a738af12a0415da252441d50cbe29745a90ad (diff) |
telegram-chat: handle missing username
-rw-r--r-- | telegram-chat | 4 |
1 files changed, 3 insertions, 1 deletions
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"); \ |