diff options
author | Christian Hesse <mail@eworm.de> | 2022-05-12 11:03:06 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-05-12 11:03:06 +0200 |
commit | 48f0a2d21118a7bff7d598e84d9f606fb30bf07a (patch) | |
tree | fb9746502335552880823e9445cd4201414bb8eb /mod/notification-matrix | |
parent | 93ec9afe558ef6eba5d513fab359bb5f6618666d (diff) | |
parent | a71a3d5466548d05d27d31c446c62afdf2412070 (diff) |
Merge branch 'scripts' into ros-v7-path-syntax
Diffstat (limited to 'mod/notification-matrix')
-rw-r--r-- | mod/notification-matrix | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mod/notification-matrix b/mod/notification-matrix index 4ec5f6c..c3cf24f 100644 --- a/mod/notification-matrix +++ b/mod/notification-matrix @@ -18,14 +18,14 @@ :local AllDone true; :local QueueLen [ :len $MatrixQueue ]; - :if ([ :len [ / system scheduler find where name="FlushMatrixQueue" ] ] > 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; } :foreach Id,Message in=$MatrixQueue do={ :if ([ :typeof $Message ] = "array" ) do={ :do { - / tool fetch check-certificate=yes-without-crl output=none http-method=post \ + /tool/fetch check-certificate=yes-without-crl output=none http-method=post \ ("https://" . $Message->"homeserver" . "/_matrix/client/r0/rooms/" . $Message->"room" . \ "/send/m.room.message?access_token=" . $Message->"accesstoken") \ http-data=("{ \"msgtype\": \"m.text\", \"body\": \"" . $Message->"plain" . "\"," . \ @@ -40,7 +40,7 @@ } :if ($AllDone = true && $QueueLen = [ :len $MatrixQueue ]) do={ - / system scheduler remove [ find where name="FlushMatrixQueue" ]; + /system/scheduler/remove [ find where name="FlushMatrixQueue" ]; :set MatrixQueue; } } @@ -113,7 +113,7 @@ } :do { - / tool fetch check-certificate=yes-without-crl output=none http-method=post \ + /tool/fetch check-certificate=yes-without-crl output=none http-method=post \ ("https://" . $HomeServer . "/_matrix/client/r0/rooms/" . $Room . \ "/send/m.room.message?access_token=" . $AccessToken) \ http-data=("{ \"msgtype\": \"m.text\", \"body\": \"" . $Plain . "\"," . \ @@ -126,15 +126,15 @@ :set MatrixQueue [ :toarray "" ]; } :local Text ([ $SymbolForNotification "alarm-clock" ] . \ - "This message was queued since " . [ / system clock get date ] . \ - " " . [ / system clock get time ] . " and may be obsolete."); + "This message was queued since " . [ /system/clock/get date ] . \ + " " . [ /system/clock/get time ] . " and may be obsolete."); :set Plain ($Plain . "\\n" . $Text); :set Formatted ($Formatted . "<br/>" . $Text); :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;"); } } |