From cc6455cadbfe70371946c5f0accdf602f6165b4a Mon Sep 17 00:00:00 2001 From: vados-dev <192440777+vados-dev@users.noreply.github.com> Date: Fri, 1 May 2026 00:25:03 +0300 Subject: [PATCH] Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:25:03 01.05.2026. --- html/AM-GlobalFunc.rsc | 4 +- html/mod/.#notification-telegram.rsc | 1 - html/mod/AM-TG-Notifications.rsc | 6 +++ html/mod/AM-TG-Notifications.rsc.diff | 75 +++++++++++---------------- html/mod/notification-telegram.rsc | 2 +- 5 files changed, 38 insertions(+), 50 deletions(-) delete mode 120000 html/mod/.#notification-telegram.rsc diff --git a/html/AM-GlobalFunc.rsc b/html/AM-GlobalFunc.rsc index a07034a73..7d6d1868c 100644 --- a/html/AM-GlobalFunc.rsc +++ b/html/AM-GlobalFunc.rsc @@ -17,9 +17,9 @@ :global GlobalFuncReady false; # Git commit id & info, expected configuration version -:global CommitId "main/316/a9611f32"; +:global CommitId "main/317/bda7131a"; :global CommitTAG "unknown"; -:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:20:03 01.05.2026."; +:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:25:03 01.05.2026."; # The variables are received right here. :global GlobalConfVersion 138; diff --git a/html/mod/.#notification-telegram.rsc b/html/mod/.#notification-telegram.rsc deleted file mode 120000 index bf238fee8..000000000 --- a/html/mod/.#notification-telegram.rsc +++ /dev/null @@ -1 +0,0 @@ -root@amster.16966 \ No newline at end of file diff --git a/html/mod/AM-TG-Notifications.rsc b/html/mod/AM-TG-Notifications.rsc index 00ab03e49..73ad0d5eb 100644 --- a/html/mod/AM-TG-Notifications.rsc +++ b/html/mod/AM-TG-Notifications.rsc @@ -93,6 +93,7 @@ # send notification via telegram - expects one array argument :set ($NotificationFunctions->"telegram") do={ :local Notification $1; + :global Identity; :global IdentityExtra; :global TelegramChatId; @@ -104,6 +105,7 @@ :global TelegramTokenId; :global TelegramTokenIdOverride; :global CertificateAvailable; + :global CharacterReplace; :global EitherOr; :global IfThenElse; @@ -111,6 +113,7 @@ :global ProtocolStrip; :global SymbolForNotification; :global UrlEncode; + :local EscapeMD do={ :local Text [ :tostr $1 ]; :local Mode [ :tostr $2 ]; @@ -185,18 +188,21 @@ } } } + # purge the Telegram queue :set PurgeTelegramQueue do={ :global TelegramQueue; /system/scheduler/remove [ find where name="_FlushTelegramQueue" ]; :set TelegramQueue; } + # send notification via telegram - expects at least two string arguments :set SendTelegram do={ :onerror Err { :global SendTelegram2; $SendTelegram2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 }); } do={:global ExitOnError; $ExitOnError $0 $Err} } + # send notification via telegram - expects one array argument :set SendTelegram2 do={ :local Notification $1; diff --git a/html/mod/AM-TG-Notifications.rsc.diff b/html/mod/AM-TG-Notifications.rsc.diff index 3cebd5828..143cb549f 100644 --- a/html/mod/AM-TG-Notifications.rsc.diff +++ b/html/mod/AM-TG-Notifications.rsc.diff @@ -1,56 +1,44 @@ -6a7 -> # -9,15d9 -< :local ExitOK false; -< :onerror Err { -< :global GlobalConfReady; :global GlobalFuncReady; -< :retry { :if ($GlobalConfReady != true || $GlobalFuncReady != true) \ -< do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50; -< :local ScriptName [ :jobname ]; -< -26a21 +19a20 > -34a30 +27a29 > -41a38 +34a37 > -44a42 +37a41 > -58a57 +51a56 > -64c63 +57c62 < :global ExitOnError; $ExitOnError $0 $Err; --- > :global ExitOnError; $ExitOnError $0 $Err; -69a69 +62a68 > -71a72 +64a71 > -75a77 +68a76 > -84a87 +77a86 > -86a90 +79a89 > -90a95 +83a94 > -97,98c102,103 +90c101 < :global ExitOnError; $ExitOnError $0 $Err; -< } } --- > :global ExitOnError; $ExitOnError $0 $Err; -> } } -102a108 +95a107 > -112a119 +105a118 > -120a128 +113a127 > -124a133 +117a132 > -126a136 +119a135 > -137c147,151 +130c146,150 < :if ($Mode = "body") do={:return ("```\n" . $Text . "\n```")} --- > @@ -58,9 +46,9 @@ > :return ("```\n" . $Text . "\n```"); > } > -139a154 +132a153 > -146,147c161,169 +139,140c160,168 < :if ([ :len $TokenId ] = 0 || [ :len $ChatId ] = 0) do={:return false} < :if ([ :typeof $TelegramMessageIDs ] = "nothing") do={:set TelegramMessageIDs ({})} --- @@ -73,38 +61,33 @@ > :set TelegramMessageIDs ({}); > } > -158c180,182 +151c179,181 < } else={:set Text ($Text . [ $EscapeMD ($Notification->"message") "body" ])} --- > } else={ > :set Text ($Text . [ $EscapeMD ($Notification->"message") "body" ]); > } -168a193 +161a192 > -183c208,211 +176c207,210 < :if ([ :typeof $TelegramQueue ] = "nothing") do={:set TelegramQueue ({})} --- > > :if ([ :typeof $TelegramQueue ] = "nothing") do={ > :set TelegramQueue ({}); > } -194a223 +191a226 > -197a227 +198a234 > -200a231 -> -203a235 -> -205,206c237,240 +200,201c236,238 < } do={:global ExitOnError; $ExitOnError $0 $Err} < } --- > } do={ > :global ExitOnError; $ExitOnError $0 $Err; > } } +205a243 > -209a244 -> -210a246 +206a245 > diff --git a/html/mod/notification-telegram.rsc b/html/mod/notification-telegram.rsc index 3849958c6..84f4bc98d 100644 --- a/html/mod/notification-telegram.rsc +++ b/html/mod/notification-telegram.rsc @@ -99,7 +99,7 @@ } } do={ :global ExitOnError; $ExitOnError $0 $Err; -} } +} } # send notification via telegram - expects one array argument :set ($NotificationFunctions->"telegram") do={ -- 2.52.0