From 6f6840680359757838664b1ae5f38cc47e90e37a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 1 Apr 2024 23:40:09 +0200 Subject: mod/notification-matrix: add new configuration snippet... ... instead of appending to global-config-overlay. --- mod/notification-matrix.rsc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'mod') diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index 8234779..5a08146 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -217,12 +217,14 @@ } :do { - /system/script/set global-config-overlay source=([ get global-config-overlay source ] . "\n" . \ + /system/script/remove [ find where name="global-config-overlay.d/mod/notification-matrix" ]; + /system/script/add name="global-config-overlay.d/mod/notification-matrix" source=( \ + "# configuration snippet: mod/notification-matrix\n\n" . \ ":global MatrixHomeServer \"" . $MatrixHomeServer . "\";\n" . \ ":global MatrixAccessToken \"" . $MatrixAccessToken . "\";\n"); - $LogPrint info $0 ("Appended configuration to global-config-overlay. Now create and join a room, please!"); + $LogPrint info $0 ("Added configuration snippet. Now create and join a room, please!"); } on-error={ - $LogPrint error $0 ("Failed appending configuration to global-config-overlay!"); + $LogPrint error $0 ("Failed adding configuration snippet!"); :return false; } } @@ -250,11 +252,12 @@ } :do { - /system/script/set global-config-overlay source=([ get global-config-overlay source ] . "\n" . \ + :local Snippet [ /system/script/find where name="global-config-overlay.d/mod/notification-matrix" ]; + /system/script/set $Snippet source=([ get $Snippet source ] . \ ":global MatrixRoom \"" . $MatrixRoom . "\";\n"); - $LogPrint info $0 ("Appended configuration to global-config-overlay. Please review and cleanup!"); + $LogPrint info $0 ("Appended configuration to configuration snippet. Please review!"); } on-error={ - $LogPrint error $0 ("Failed appending configuration to global-config-overlay!"); + $LogPrint error $0 ("Failed appending configuration to snippet!"); :return false; } } -- cgit v1.2.3-70-g09d2