From 47a657d25c44910b548410dea84b092e5d5488dc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Jan 2023 00:31:49 +0100 Subject: mod/notification-*: support extra text (or emojis 🚀) in notification tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mod/notification-matrix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mod/notification-matrix') diff --git a/mod/notification-matrix b/mod/notification-matrix index c43514d..6266b75 100644 --- a/mod/notification-matrix +++ b/mod/notification-matrix @@ -56,6 +56,7 @@ :local Notification $1; :global Identity; + :global IdentityExtra; :global MatrixAccessToken; :global MatrixAccessTokenOverride; :global MatrixHomeServer; @@ -106,10 +107,11 @@ :return false; } - :local Plain [ $PrepareText ("## [" . $Identity . "] " . ($Notification->"subject") . "\n```\n" . \ - ($Notification->"message") . "\n```") "plain" ]; - :local Formatted ("

" . [ $PrepareText ("[" . $Identity . "] " . ($Notification->"subject")) "format" ] . "

" . \ - "
" . [ $PrepareText ($Notification->"message") "format" ] . "
"); + :local Plain [ $PrepareText ("## [" . $IdentityExtra . $Identity . "] " . \ + ($Notification->"subject") . "\n```\n" . ($Notification->"message") . "\n```") "plain" ]; + :local Formatted ("

" . [ $PrepareText ("[" . $IdentityExtra . $Identity . "] " . \ + ($Notification->"subject")) "format" ] . "

" . "
" . \
+    [ $PrepareText ($Notification->"message") "format" ] . "
"); :if ([ :len ($Notification->"link") ] > 0) do={ :set Plain ($Plain . "\\n" . [ $SymbolForNotification "link" ] . \ [ $PrepareText ("[" . $Notification->"link" . "](" . $Notification->"link" . ")") "plain" ]); -- cgit v1.2.3-54-g00ecf