Add back message list watching, support attachments without metadata
This commit is contained in:
@@ -110,11 +110,13 @@ private class TranscriptDrawingArea : Widget
|
|||||||
|
|
||||||
// Check for attachments. For each one, add an image layout bubble
|
// Check for attachments. For each one, add an image layout bubble
|
||||||
foreach (var attachment in message.attachments) {
|
foreach (var attachment in message.attachments) {
|
||||||
|
Graphene.Size? image_size = null;
|
||||||
if (attachment.metadata != null) {
|
if (attachment.metadata != null) {
|
||||||
var image_size = Graphene.Size() {
|
image_size = Graphene.Size() {
|
||||||
width = attachment.metadata.attribution_info.width,
|
width = attachment.metadata.attribution_info.width,
|
||||||
height = attachment.metadata.attribution_info.height
|
height = attachment.metadata.attribution_info.height
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var image_layout = new ImageBubbleLayout(attachment.preview_path, message.from_me, this, max_width, image_size);
|
var image_layout = new ImageBubbleLayout(attachment.preview_path, message.from_me, this, max_width, image_size);
|
||||||
image_layout.is_downloaded = attachment.preview_downloaded;
|
image_layout.is_downloaded = attachment.preview_downloaded;
|
||||||
@@ -130,7 +132,6 @@ private class TranscriptDrawingArea : Widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
last_sender = message.sender;
|
last_sender = message.sender;
|
||||||
last_date = date;
|
last_date = date;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class TranscriptView : Adw.Bin
|
|||||||
});
|
});
|
||||||
|
|
||||||
value.load_messages();
|
value.load_messages();
|
||||||
|
value.watch_updates();
|
||||||
} else {
|
} else {
|
||||||
transcript_drawing_area.set_messages(new ArrayList<Message>());
|
transcript_drawing_area.set_messages(new ArrayList<Message>());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user