From 0aeb34e5e9cb9ddaee7316b60e0e9eaeadb428d3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 6 Aug 2023 16:25:52 +0200 Subject: mod/notification-matrix: introduce $PurgeMatrixQueue ... to purge the queue and remove the scheduler. --- doc/mod/notification-matrix.md | 5 +++++ mod/notification-matrix.rsc | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/doc/mod/notification-matrix.md b/doc/mod/notification-matrix.md index 070ed9f..ab8efc9 100644 --- a/doc/mod/notification-matrix.md +++ b/doc/mod/notification-matrix.md @@ -110,6 +110,11 @@ Place this before you call them: :global SendMatrix; :global SendNotification; +In case there is a situation when the queue needs to be purged there is a +function available: + + $PurgeMatrixQueue; + See also -------- diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index 16b2370..03cfb13 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -9,6 +9,7 @@ :global FlushMatrixQueue; :global NotificationFunctions; +:global PurgeMatrixQueue; :global SendMatrix; :global SendMatrix2; @@ -151,6 +152,14 @@ } } +# purge the Matrix queue +:set PurgeMatrixQueue do={ + :global MatrixQueue; + + /system/scheduler/remove [ find where name="\$FlushMatrixQueue" ]; + :set MatrixQueue; +} + # send notification via Matrix - expects at least two string arguments :set SendMatrix do={ :global SendMatrix2; -- cgit v1.2.3-54-g00ecf