diff --git a/src/API/Attachment.vala b/src/API/Attachment.vala index fc04cd3..f212cfe 100644 --- a/src/API/Attachment.vala +++ b/src/API/Attachment.vala @@ -4,6 +4,7 @@ public class Tootle.Attachment{ public string type; public string url; public string preview_url; + public string? description; public Attachment(int64 id){ this.id = id; @@ -17,6 +18,9 @@ public class Tootle.Attachment{ attachment.preview_url = obj.get_string_member ("preview_url"); attachment.url = obj.get_string_member ("url"); + if (obj.has_member ("description")) + attachment.description = obj.get_string_member ("description"); + return attachment; } diff --git a/src/Widgets/AttachmentWidget.vala b/src/Widgets/AttachmentWidget.vala index e25fa7f..923ae31 100644 --- a/src/Widgets/AttachmentWidget.vala +++ b/src/Widgets/AttachmentWidget.vala @@ -52,6 +52,7 @@ public class Tootle.AttachmentWidget : Gtk.EventBox { image.valign = Gtk.Align.CENTER; image.halign = Gtk.Align.CENTER; image.margin = 3; + image.set_tooltip_text (attachment.description); image.show (); if (editable) Tootle.network.load_scaled_image (attachment.preview_url, image, get_small_size ());