diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/notification-email.rsc | 8 | ||||
-rw-r--r-- | mod/notification-matrix.rsc | 10 | ||||
-rw-r--r-- | mod/notification-ntfy.rsc | 10 | ||||
-rw-r--r-- | mod/notification-telegram.rsc | 10 |
4 files changed, 19 insertions, 19 deletions
diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index a505a50..774af4c 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -26,7 +26,7 @@ :local AllDone true; :local QueueLen [ :len $EmailQueue ]; - :local Scheduler [ /system/scheduler/find where name=$0 ]; + :local Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ]; :if ([ :len $Scheduler ] > 0 && [ /system/scheduler/get $Scheduler interval ] < 1m) do={ /system/scheduler/set interval=1m comment="Doing initial checks..." $Scheduler; @@ -152,8 +152,8 @@ [ $IfThenElse ([ :len ($Notification->"link") ] > 0) ("\n\n" . ($Notification->"link")) "" ] . \ [ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]); \ attach=($Notification->"attach"); remove-attach=($Notification->"remove-attach") }; - :if ([ :len [ /system/scheduler/find where name="\$FlushEmailQueue" ] ] = 0) do={ - /system/scheduler/add name="\$FlushEmailQueue" interval=1s start-time=startup \ + :if ([ :len [ /system/scheduler/find where name="_FlushEmailQueue" ] ] = 0) do={ + /system/scheduler/add name="_FlushEmailQueue" interval=1s start-time=startup \ comment="Queuing new mail..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;"); } } @@ -162,7 +162,7 @@ :set PurgeEMailQueue do={ :global EmailQueue; - /system/scheduler/remove [ find where name="\$FlushEmailQueue" ]; + /system/scheduler/remove [ find where name="_FlushEmailQueue" ]; :set EmailQueue; } diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index a8983a7..378faab 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -30,7 +30,7 @@ :local AllDone true; :local QueueLen [ :len $MatrixQueue ]; - :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={ + :if ([ :len [ /system/scheduler/find where name="_FlushMatrixQueue" ] ] > 0 && $QueueLen = 0) do={ $LogPrintExit2 warning $0 ("Flushing Matrix messages from scheduler, but queue is empty.") false; } @@ -52,7 +52,7 @@ } :if ($AllDone = true && $QueueLen = [ :len $MatrixQueue ]) do={ - /system/scheduler/remove [ find where name=$0 ]; + /system/scheduler/remove [ find where name="_FlushMatrixQueue" ]; :set MatrixQueue; } } @@ -147,8 +147,8 @@ :set ($MatrixQueue->[ :len $MatrixQueue ]) { room=$Room; \ accesstoken=$AccessToken; homeserver=$HomeServer; \ plain=$Plain; formatted=$Formatted }; - :if ([ :len [ /system/scheduler/find where name="\$FlushMatrixQueue" ] ] = 0) do={ - /system/scheduler/add name="\$FlushMatrixQueue" interval=1m start-time=startup \ + :if ([ :len [ /system/scheduler/find where name="_FlushMatrixQueue" ] ] = 0) do={ + /system/scheduler/add name="_FlushMatrixQueue" interval=1m start-time=startup \ on-event=(":global FlushMatrixQueue; \$FlushMatrixQueue;"); } } @@ -158,7 +158,7 @@ :set PurgeMatrixQueue do={ :global MatrixQueue; - /system/scheduler/remove [ find where name="\$FlushMatrixQueue" ]; + /system/scheduler/remove [ find where name="_FlushMatrixQueue" ]; :set MatrixQueue; } diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index e2fc558..5c0e9e5 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -28,7 +28,7 @@ :local AllDone true; :local QueueLen [ :len $NtfyQueue ]; - :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={ + :if ([ :len [ /system/scheduler/find where name="_FlushNtfyQueue" ] ] > 0 && $QueueLen = 0) do={ $LogPrintExit2 warning $0 ("Flushing Ntfy messages from scheduler, but queue is empty.") false; } @@ -46,7 +46,7 @@ } :if ($AllDone = true && $QueueLen = [ :len $NtfyQueue ]) do={ - /system/scheduler/remove [ find where name=$0 ]; + /system/scheduler/remove [ find where name="_FlushNtfyQueue" ]; :set NtfyQueue; } } @@ -103,8 +103,8 @@ "This message was queued since " . [ /system/clock/get date ] . " " . \ [ /system/clock/get time ] . " and may be obsolete."); :set ($NtfyQueue->[ :len $NtfyQueue ]) { url=$Url; headers=$Headers; text=$Text }; - :if ([ :len [ /system/scheduler/find where name="\$FlushNtfyQueue" ] ] = 0) do={ - /system/scheduler/add name="\$FlushNtfyQueue" interval=1m start-time=startup \ + :if ([ :len [ /system/scheduler/find where name="_FlushNtfyQueue" ] ] = 0) do={ + /system/scheduler/add name="_FlushNtfyQueue" interval=1m start-time=startup \ on-event=(":global FlushNtfyQueue; \$FlushNtfyQueue;"); } } @@ -114,7 +114,7 @@ :set PurgeNtfyQueue do={ :global NtfyQueue; - /system/scheduler/remove [ find where name="\$FlushNtfyQueue" ]; + /system/scheduler/remove [ find where name="_FlushNtfyQueue" ]; :set NtfyQueue; } diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index b5729a4..66be7d3 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -29,7 +29,7 @@ :local AllDone true; :local QueueLen [ :len $TelegramQueue ]; - :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={ + :if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] > 0 && $QueueLen = 0) do={ $LogPrintExit2 warning $0 ("Flushing Telegram messages from scheduler, but queue is empty.") false; } @@ -51,7 +51,7 @@ } :if ($AllDone = true && $QueueLen = [ :len $TelegramQueue ]) do={ - /system/scheduler/remove [ find where name=$0 ]; + /system/scheduler/remove [ find where name="_FlushTelegramQueue" ]; :set TelegramQueue; } } @@ -155,8 +155,8 @@ " " . [ /system/clock/get time ] . " and may be obsolete.") "plain" ]) ]); :set ($TelegramQueue->[ :len $TelegramQueue ]) { chatid=$ChatId; tokenid=$TokenId; text=$Text; silent=($Notification->"silent"); replyto=($Notification->"replyto") }; - :if ([ :len [ /system/scheduler/find where name="\$FlushTelegramQueue" ] ] = 0) do={ - /system/scheduler/add name="\$FlushTelegramQueue" interval=1m start-time=startup \ + :if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] = 0) do={ + /system/scheduler/add name="_FlushTelegramQueue" interval=1m start-time=startup \ on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;"); } } @@ -166,7 +166,7 @@ :set PurgeTelegramQueue do={ :global TelegramQueue; - /system/scheduler/remove [ find where name="\$FlushTelegramQueue" ]; + /system/scheduler/remove [ find where name="_FlushTelegramQueue" ]; :set TelegramQueue; } |