global-functions: $SendTelegram: change internal wording

This commit is contained in:
Christian Hesse 2020-11-26 22:06:03 +01:00
parent 54e164e542
commit d7725540f8

View file

@ -779,12 +779,12 @@
:global IfThenElse;
:if ($TelegramFixedWidthFont != true) do={
:return ($1 . [ $IfThenElse ($2 = "fixed") "\n" "" ]);
:return ($1 . [ $IfThenElse ($2 = "body") "\n" "" ]);
}
:local Return $1;
:local Chars {
"fixed"={ "\\"; "`" };
"body"={ "\\"; "`" };
"hint"={ "_"; "*"; "["; "]"; "("; ")"; "~"; "`"; ">";
"#"; "+"; "-"; "="; "|"; "{"; "}"; "."; "!" };
}
@ -792,7 +792,7 @@
:set Return [ $CharacterReplace $Return $Char ("\\" . $Char) ];
}
:if ($2 = "fixed") do={
:if ($2 = "body") do={
:return ("```\n" . $Return . "\n```");
}
@ -810,11 +810,11 @@
:local Text ("[" . $Identity . "] " . $Subject . "\n\n" . $Message);
:if ([ :len $Text ] > 3968) do={
:set Text ([ $EscapeMD ([ :pick $Text 0 3840 ] . "...") "fixed" ] . \
:set Text ([ $EscapeMD ([ :pick $Text 0 3840 ] . "...") "body" ] . \
"\n" . [ $SymbolForNotification "scissors" ] . \
[ $EscapeMD "The Telegram message was too long and has been truncated!" "hint" ]);
} else={
:set Text [ $EscapeMD $Text "fixed" ];
:set Text [ $EscapeMD $Text "body" ];
}
:set Text [ $UrlEncode $Text ];
:local ParseMode [ $IfThenElse ($TelegramFixedWidthFont = true) "MarkdownV2" "" ];