diff --git a/src/Services/Notification.vala b/src/Services/Notification.vala index 3e1add10..e4616080 100644 --- a/src/Services/Notification.vala +++ b/src/Services/Notification.vala @@ -35,6 +35,7 @@ public class Notifications.Notification : Object { public string sender; public string[] actions; public List buttons; + public string category { get; private set; } public string? default_action { get; private set; default = null; } public uint32 replaces_id; public uint32 server_id { get; construct set; default = 0; } // 0 means the notification is outdated i.e. not present in the server anymore @@ -143,6 +144,9 @@ public class Notifications.Notification : Object { } } + // GLib.Notification.set_category () + category = lookup_string (hints, "category"); + if (app_info == null) { desktop_id = FALLBACK_DESKTOP_ID; app_info = new DesktopAppInfo (desktop_id); diff --git a/src/Widgets/NotificationEntry.vala b/src/Widgets/NotificationEntry.vala index 24876406..71168aba 100644 --- a/src/Widgets/NotificationEntry.vala +++ b/src/Widgets/NotificationEntry.vala @@ -63,7 +63,6 @@ public class Notifications.NotificationEntry : Gtk.ListBoxRow { }; image_overlay.add_overlay (secondary_image); - Icon app_icon = new ThemedIcon ("dialog-information"); if (notification.app_icon.contains ("/")) { var file = File.new_for_uri (notification.app_icon); @@ -81,6 +80,14 @@ public class Notifications.NotificationEntry : Gtk.ListBoxRow { primary_image.add_css_class (Granite.CssClass.CARD); primary_image.add_css_class (Granite.CssClass.CHECKERBOARD); secondary_image.gicon = app_icon; + + // Assume this is an avatar + if (notification.category == "im.received" || + // Hardcoding is evil but this bothers me + notification.app_icon == "com.discordapp.Discord" + ) { + primary_image.add_css_class (Granite.CssClass.CIRCULAR); + } } else { primary_image.gicon = app_icon; }