]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:15:02 01.05.2026.
authorvados-dev <192440777+vados-dev@users.noreply.github.com>
Thu, 30 Apr 2026 21:15:03 +0000 (00:15 +0300)
committervados-dev <192440777+vados-dev@users.noreply.github.com>
Thu, 30 Apr 2026 21:15:03 +0000 (00:15 +0300)
html/AM-GlobalFunc.rsc
html/mod/.#notification-telegram.rsc [moved from html/mod/.#AM-TG-Notifications.rsc with 100% similarity]
html/mod/AM-TG-Notifications.rsc
html/mod/AM-TG-Notifications.rsc.diff

index a4b960d30e04ec9cd4715fc7eb408d9b9c6cc4d1..16dc1f46143146527df469efb893e31eaca330d0 100644 (file)
@@ -17,9 +17,9 @@
 :global GlobalFuncReady false;
 
 # Git commit id & info, expected configuration version
-:global CommitId "main/314/b8ef8d13";
+:global CommitId "main/315/84d64b90";
 :global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:10:03 01.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:15:02 01.05.2026.";
 
 # The variables are received right here.
 :global GlobalConfVersion 138;
index a1ab5e227750067c0f1c426e833a27c4c852528e..951c7f121f2a1b3a6b29c479e3d1cd25fe214f63 100644 (file)
   :global CertificateAvailable;
   :global IsFullyConnected;
   :global LogPrint;
- 
-  #:if ([ $IsFullyConnected ] = false) do={
-  #  $LogPrint debug $0 ("System is not fully connected, not flushing.");
-  #  :return false;
-  #}
+
+  :if ([ $IsFullyConnected ] = false) do={
+    $LogPrint debug $0 ("System is not fully connected, not flushing.");
+    :return false;
+  }
   :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
     $LogPrint warning $0 ("Downloading required certificate failed.");
     :return false;
     /system/scheduler/remove [ find where name="_FlushTelegramQueue" ];
     :set TelegramQueue;
   }
-} do={:global ExitOnError; $ExitOnError $0 $Err}
-}
+} do={
+:global ExitOnError; $ExitOnError $0 $Err;
+} }
+
 # get the chat id
 :set GetTelegramChatId do={ :onerror Err {
   :global TelegramTokenId;
-#  :global CertificateAvailable;
+  :global CertificateAvailable;
   :global LogPrint;
-#  :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
-#    $LogPrint warning $0 ("Downloading required certificate failed.");
-#    :return false;
-#  }
+  :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
+    $LogPrint warning $0 ("Downloading required certificate failed.");
+    :return false;
+  }
   :local Data;
   :onerror Err {
     :set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
   :if (($Message->"is_topic_message") = true) do={
     $LogPrint info $0 ("The thread id is: " . ($Message->"message_thread_id"));
   }
-} do={:global ExitOnError; $ExitOnError $0 $Err}
-} 
+} do={
+:global ExitOnError; $ExitOnError $0 $Err;
+} }
+
 # send notification via telegram - expects one array argument
 :set ($NotificationFunctions->"telegram") do={
   :local Notification $1;
index 2e31baf10a58d8a14d4873a97c8f3b6a45738c8f..4e8667d8e40f85ae5f83bc848062a47833089d2e 100644 (file)
 > # https://rsc.eworm.de/doc/mod/notification-telegram.md
 26a23
 > 
-30,34c27,32
-<  
-<   #:if ([ $IsFullyConnected ] = false) do={
-<   #  $LogPrint debug $0 ("System is not fully connected, not flushing.");
-<   #  :return false;
-<   #}
----
-> 
->   :if ([ $IsFullyConnected ] = false) do={
->     $LogPrint debug $0 ("System is not fully connected, not flushing.");
->     :return false;
->   }
+34a32
 > 
 41a40
 > 
 > 
 58a59
 > 
-63,64c64,67
-< } do={:global ExitOnError; $ExitOnError $0 $Err}
-< }
+64c65
+< :global ExitOnError; $ExitOnError $0 $Err;
 ---
-> } do={
 >   :global ExitOnError; $ExitOnError $0 $Err;
-> } }
+69a71
 > 
-68c71,72
-< #  :global CertificateAvailable;
----
-> 
->   :global CertificateAvailable;
-70,73c74,79
-< #  :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
-< #    $LogPrint warning $0 ("Downloading required certificate failed.");
-< #    :return false;
-< #  }
----
+71a74
 > 
->   :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
->     $LogPrint warning $0 ("Downloading required certificate failed.");
->     :return false;
->   }
+75a79
 > 
-82a89
+84a89
 > 
-84a92
+86a92
 > 
-88a97
+90a97
 > 
-94,95c103,106
-< } do={:global ExitOnError; $ExitOnError $0 $Err}
-< } 
+97,98c104,105
+< :global ExitOnError; $ExitOnError $0 $Err;
+< } }
 ---
-> } do={
 >   :global ExitOnError; $ExitOnError $0 $Err;
 > } } 
+102a110
 > 
-98a110
-> 
-108a121
+112a121
 > 
-116a130
+120a130
 > 
-120a135
+124a135
 > 
-122a138
+126a138
 > 
-133c149,153
+137c149,153
 <     :if ($Mode = "body") do={:return ("```\n" . $Text . "\n```")}
 ---
 > 
@@ -98,9 +70,9 @@
 >       :return ("```\n" . $Text . "\n```");
 >     }
 > 
-135a156
+139a156
 > 
-142,143c163,171
+146,147c163,171
 <   :if ([ :len $TokenId ] = 0 || [ :len $ChatId ] = 0) do={:return false}
 <   :if ([ :typeof $TelegramMessageIDs ] = "nothing") do={:set TelegramMessageIDs ({})}
 ---
 >     :set TelegramMessageIDs ({});
 >   }
 > 
-154c182,184
+158c182,184
 <   } else={:set Text ($Text . [ $EscapeMD ($Notification->"message") "body" ])}
 ---
 >   } else={
 >     :set Text ($Text . [ $EscapeMD ($Notification->"message") "body" ]);
 >   }
-164a195
+168a195
 > 
-179c210,213
+183c210,213
 <     :if ([ :typeof $TelegramQueue ] = "nothing") do={:set TelegramQueue ({})}
 ---
 > 
 >     :if ([ :typeof $TelegramQueue ] = "nothing") do={
 >       :set TelegramQueue ({});
 >     }
-190a225
+194a225
 > 
-193a229
+197a229
 > 
-196a233
+200a233
 > 
-199a237
+203a237
 > 
-201,202c239,242
+205,206c239,242
 < } do={:global ExitOnError; $ExitOnError $0 $Err}
 < }
 ---
 >   :global ExitOnError; $ExitOnError $0 $Err;
 > } }
 > 
-205a246
+209a246
 > 
-206a248
+210a248
 >