diff --git a/src/transcript/transcript-drawing-area.vala b/src/transcript/transcript-drawing-area.vala index e7482c2..6507301 100644 --- a/src/transcript/transcript-drawing-area.vala +++ b/src/transcript/transcript-drawing-area.vala @@ -110,24 +110,25 @@ private class TranscriptDrawingArea : Widget // Check for attachments. For each one, add an image layout bubble foreach (var attachment in message.attachments) { + Graphene.Size? image_size = null; if (attachment.metadata != null) { - var image_size = Graphene.Size() { + image_size = Graphene.Size() { width = attachment.metadata.attribution_info.width, height = attachment.metadata.attribution_info.height - }; + }; + } - var image_layout = new ImageBubbleLayout(attachment.preview_path, message.from_me, this, max_width, image_size); - image_layout.is_downloaded = attachment.preview_downloaded; - items.add(image_layout); + var image_layout = new ImageBubbleLayout(attachment.preview_path, message.from_me, this, max_width, image_size); + image_layout.is_downloaded = attachment.preview_downloaded; + items.add(image_layout); - // If the attachment isn't downloaded, queue a download since we are going to be showing it here. - // TODO: Probably would be better if we only did this for stuff in the viewport. - if (!attachment.preview_downloaded) { - try { - Repository.get_instance().download_attachment(attachment.guid, true); - } catch (GLib.Error e) { - warning("Wasn't able to message daemon about queuing attachment download: %s", e.message); - } + // If the attachment isn't downloaded, queue a download since we are going to be showing it here. + // TODO: Probably would be better if we only did this for stuff in the viewport. + if (!attachment.preview_downloaded) { + try { + Repository.get_instance().download_attachment(attachment.guid, true); + } catch (GLib.Error e) { + warning("Wasn't able to message daemon about queuing attachment download: %s", e.message); } } } diff --git a/src/transcript/transcript-view.vala b/src/transcript/transcript-view.vala index 9d22574..e2555cc 100644 --- a/src/transcript/transcript-view.vala +++ b/src/transcript/transcript-view.vala @@ -26,6 +26,7 @@ public class TranscriptView : Adw.Bin }); value.load_messages(); + value.watch_updates(); } else { transcript_drawing_area.set_messages(new ArrayList()); }