5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-25 16:25:40 +00:00

Fix telegram attachment comment formatting and escaping (#1920)

This commit is contained in:
Alexander 2022-11-27 01:50:46 +03:00 committed by GitHub
parent 0c83946983
commit 9bbdf70e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)