mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-21 22:50:27 +00:00
Fix telegram attachment comment formatting and escaping (#1920)
This commit is contained in:
parent
0c83946983
commit
9bbdf70e69
@ -451,6 +451,11 @@ func (b *Btelegram) handleUploadFile(msg *config.Message, chatid int64, parentID
|
|||||||
Name: fi.Name,
|
Name: fi.Name,
|
||||||
Bytes: *fi.Data,
|
Bytes: *fi.Data,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if b.GetString("MessageFormat") == HTMLFormat {
|
||||||
|
fi.Comment = makeHTML(html.EscapeString(fi.Comment))
|
||||||
|
}
|
||||||
|
|
||||||
switch filepath.Ext(fi.Name) {
|
switch filepath.Ext(fi.Name) {
|
||||||
case ".jpg", ".jpe", ".png":
|
case ".jpg", ".jpe", ".png":
|
||||||
pc := tgbotapi.NewInputMediaPhoto(file)
|
pc := tgbotapi.NewInputMediaPhoto(file)
|
||||||
|
Loading…
Reference in New Issue
Block a user