mod/notification-ntfy: use custom user agent string

This commit is contained in:
Christian Hesse 2024-04-09 23:50:00 +02:00
parent ca2e5f2a01
commit fb865ba114

View file

@ -72,6 +72,7 @@
:global CertificateAvailable; :global CertificateAvailable;
:global EitherOr; :global EitherOr;
:global FetchUserAgentStr;
:global IfThenElse; :global IfThenElse;
:global LogPrint; :global LogPrint;
:global SymbolForNotification; :global SymbolForNotification;
@ -87,7 +88,8 @@
} }
:local Url ("https://" . $NtfyServer . "/" . [ $UrlEncode $NtfyTopic ]); :local Url ("https://" . $NtfyServer . "/" . [ $UrlEncode $NtfyTopic ]);
:local Headers ({ ("Priority: " . [ $IfThenElse ($Notification->"silent") "low" "default" ]); \ :local Headers ({ [ $FetchUserAgentStr ($Notification->"origin") ]; \
("Priority: " . [ $IfThenElse ($Notification->"silent") "low" "default" ]); \
("Title: " . "[" . $IdentityExtra . $Identity . "] " . ($Notification->"subject")) }); ("Title: " . "[" . $IdentityExtra . $Identity . "] " . ($Notification->"subject")) });
:local Text (($Notification->"message") . "\n"); :local Text (($Notification->"message") . "\n");
:if ([ :len ($Notification->"link") ] > 0) do={ :if ([ :len ($Notification->"link") ] > 0) do={