diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/messages/imagemessage.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ui/messages/imagemessage.go b/ui/messages/imagemessage.go index c9301c5..04103b4 100644 --- a/ui/messages/imagemessage.go +++ b/ui/messages/imagemessage.go @@ -59,10 +59,7 @@ func (msg *ImageMessage) RegisterMatrix(matrix ifc.MatrixContainer) { msg.matrix = matrix if len(msg.data) == 0 { - go func() { - defer debug.Recover() - msg.updateData() - }() + go msg.updateData() } } @@ -71,12 +68,14 @@ func (msg *ImageMessage) NotificationContent() string { } func (msg *ImageMessage) updateData() { + defer debug.Recover() debug.Print("Loading image:", msg.Homeserver, msg.FileID) data, _, _, err := msg.matrix.Download(fmt.Sprintf("mxc://%s/%s", msg.Homeserver, msg.FileID)) if err != nil { debug.Print("Failed to download image %s/%s: %v", msg.Homeserver, msg.FileID, err) return } + debug.Print("Image", msg.Homeserver, msg.FileID, "loaded.") msg.data = data } |