aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-01-11 00:31:49 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-01-12 15:40:05 +0100
commit47a657d25c44910b548410dea84b092e5d5488dc (patch)
tree1f816b6f15e0f5ddb6fc944a246e34580601eb55 /mod
parentc8e22f33c25db61a3f8287aae812017f79e8cba1 (diff)
mod/notification-*: support extra text (or emojis 🚀) in notification tagschange-87
Diffstat (limited to 'mod')
-rw-r--r--mod/notification-email3
-rw-r--r--mod/notification-matrix10
-rw-r--r--mod/notification-telegram4
3 files changed, 11 insertions, 6 deletions
diff --git a/mod/notification-email b/mod/notification-email
index 8868941..b03e176 100644
--- a/mod/notification-email
+++ b/mod/notification-email
@@ -107,10 +107,11 @@
# generate the e-mail subject
:set NotificationEMailSubject do={
:global Identity;
+ :global IdentityExtra;
:global QuotedPrintable;
- :return [ $QuotedPrintable ("[" . $Identity . "] " . $1) ];
+ :return [ $QuotedPrintable ("[" . $IdentityExtra . $Identity . "] " . $1) ];
}
# send notification via e-mail - expects one array argument
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 ("<h2>" . [ $PrepareText ("[" . $Identity . "] " . ($Notification->"subject")) "format" ] . "</h2>" . \
- "<pre><code>" . [ $PrepareText ($Notification->"message") "format" ] . "</code></pre>");
+ :local Plain [ $PrepareText ("## [" . $IdentityExtra . $Identity . "] " . \
+ ($Notification->"subject") . "\n```\n" . ($Notification->"message") . "\n```") "plain" ];
+ :local Formatted ("<h2>" . [ $PrepareText ("[" . $IdentityExtra . $Identity . "] " . \
+ ($Notification->"subject")) "format" ] . "</h2>" . "<pre><code>" . \
+ [ $PrepareText ($Notification->"message") "format" ] . "</code></pre>");
:if ([ :len ($Notification->"link") ] > 0) do={
:set Plain ($Plain . "\\n" . [ $SymbolForNotification "link" ] . \
[ $PrepareText ("[" . $Notification->"link" . "](" . $Notification->"link" . ")") "plain" ]);
diff --git a/mod/notification-telegram b/mod/notification-telegram
index de8cdd8..03ccc3b 100644
--- a/mod/notification-telegram
+++ b/mod/notification-telegram
@@ -55,6 +55,7 @@
:local Notification $1;
:global Identity;
+ :global IdentityExtra;
:global TelegramChatId;
:global TelegramChatIdOverride;
:global TelegramFixedWidthFont;
@@ -105,7 +106,8 @@
}
:local Truncated false;
- :local Text ("*__" . [ $EscapeMD ("[" . $Identity . "] " . ($Notification->"subject")) "plain" ] . "__*\n\n");
+ :local Text ("*__" . [ $EscapeMD ("[" . $IdentityExtra . $Identity . "] " . \
+ ($Notification->"subject")) "plain" ] . "__*\n\n");
:local LenSubject [ :len $Text ];
:local LenMessage [ :len ($Notification->"message") ];
:local LenLink [ :len ($Notification->"link") ];