talkatu/talkatu

Parents 5bcae6599448
Children 14150e2ef19b
For image, make the preview return a copy of the image and set the remote filename to something non-descriptive
--- a/talkatu/talkatuattachment.c Thu Feb 06 23:07:39 2020 -0600
+++ b/talkatu/talkatuattachment.c Fri Apr 24 01:23:51 2020 -0500
@@ -454,6 +454,15 @@
g_return_val_if_fail(TALKATU_IS_ATTACHMENT(attachment), NULL);
if(g_str_has_prefix(attachment->content_type, "image/")) {
+ if(attachment->local_uri != NULL) {
+ GFile *file = g_file_new_for_uri(attachment->local_uri);
+ GIcon *icon = g_file_icon_new(file);
+
+ g_object_unref(G_OBJECT(file));
+
+ return icon;
+ }
+
name = "image-x-generic";
} else if(g_str_has_prefix(attachment->content_type, "text/")) {
name = "text-x-generic";
--- a/talkatu/talkatuinput.c Thu Feb 06 23:07:39 2020 -0600
+++ b/talkatu/talkatuinput.c Fri Apr 24 01:23:51 2020 -0500
@@ -482,9 +482,16 @@
comment = talkatu_markup_get_html(buffer, NULL);
attachment = talkatu_attachment_new(G_GUINT64_CONSTANT(0), "image/png");
+
+ filename = g_file_get_uri(file);
talkatu_attachment_set_local_uri(attachment, filename);
g_free(filename);
+ /* for the remote side, we're set the filename to something
+ * non-descriptive.
+ */
+ talkatu_attachment_set_remote_uri(attachment, "unknown.png");
+
talkatu_attachment_set_size(attachment, size);
dialog = talkatu_attachment_dialog_new(attachment, comment);