summaryrefslogtreecommitdiffstats
path: root/bridge/telegram
diff options
context:
space:
mode:
authorAlexander <korelskiy@uteka.ru>2022-11-27 01:50:46 +0300
committerGitHub <noreply@github.com>2022-11-26 23:50:46 +0100
commit9bbdf70e69182c9677152bc69109a5992700192e (patch)
treea3b1700752a0805d59bd2a5530995de86e520ac9 /bridge/telegram
parent0c839469839314f432703b8294cf318d5d16d785 (diff)
downloadmatterbridge-msglm-9bbdf70e69182c9677152bc69109a5992700192e.tar.gz
matterbridge-msglm-9bbdf70e69182c9677152bc69109a5992700192e.tar.bz2
matterbridge-msglm-9bbdf70e69182c9677152bc69109a5992700192e.zip
Fix telegram attachment comment formatting and escaping (#1920)
Diffstat (limited to 'bridge/telegram')
-rw-r--r--bridge/telegram/handlers.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go
index ad41354e..b9cc7e6f 100644
--- a/bridge/telegram/handlers.go
+++ b/bridge/telegram/handlers.go
@@ -451,6 +451,11 @@ func (b *Btelegram) handleUploadFile(msg *config.Message, chatid int64, parentID
Name: fi.Name,
Bytes: *fi.Data,
}
+
+ if b.GetString("MessageFormat") == HTMLFormat {
+ fi.Comment = makeHTML(html.EscapeString(fi.Comment))
+ }
+
switch filepath.Ext(fi.Name) {
case ".jpg", ".jpe", ".png":
pc := tgbotapi.NewInputMediaPhoto(file)