diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-04-30 12:01:24 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-04-30 12:01:24 +0300 |
commit | 74119ee2420439a313f50ae0906a628c4ac41863 (patch) | |
tree | f2736042c291820693caab19b3c4d623a9c6bc5b /ui/messages | |
parent | d1b62b854c1da0a5b2df30ae268f29a8fa907cd0 (diff) |
Move defer and add a debug print
Diffstat (limited to 'ui/messages')
-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 } |