Skip to content

Commit

Permalink
Fix telegram attachment comment formatting and escaping (#1920)
Browse files Browse the repository at this point in the history
  • Loading branch information
sas1024 committed Nov 26, 2022
1 parent 0c83946 commit 9bbdf70
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bridge/telegram/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9bbdf70

Please sign in to comment.