Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit e9ef9972295de8615cc25e4194320a94596e3ec1 Author: Alexander <korelskiy@uteka.ru> Date: Sun Nov 27 01:50:46 2022 +0000 Fix telegram attachment comment formatting and escaping (#1920) diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index ad41354..b9cc7e6 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -4516 +45111 @@ 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)