forked from MirrorHub/mautrix-whatsapp
Send error message if downloading media from WhatsApp fails
This commit is contained in:
parent
2c89089650
commit
f28322d1f7
1 changed files with 6 additions and 0 deletions
|
@ -906,6 +906,12 @@ func (portal *Portal) HandleMediaMessage(source *User, download func() ([]byte,
|
||||||
data, err := download()
|
data, err := download()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
portal.log.Errorfln("Failed to download media for %s: %v", info.Id, err)
|
portal.log.Errorfln("Failed to download media for %s: %v", info.Id, err)
|
||||||
|
resp, err := portal.MainIntent().SendNotice(portal.MXID, "Failed to bridge media")
|
||||||
|
if err != nil {
|
||||||
|
portal.log.Errorfln("Failed to send media download error message for %s: %v", info.Id, err)
|
||||||
|
} else {
|
||||||
|
portal.finishHandling(source, info.Source, resp.EventID)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue