aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-notify-manager.h1
-rw-r--r--src/empathy-notifications-approver.c25
2 files changed, 26 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-notify-manager.h b/libempathy-gtk/empathy-notify-manager.h
index f7c5e4c5a..dd7565c9f 100644
--- a/libempathy-gtk/empathy-notify-manager.h
+++ b/libempathy-gtk/empathy-notify-manager.h
@@ -32,6 +32,7 @@ G_BEGIN_DECLS
#define EMPATHY_NOTIFY_MANAGER_CAP_BODY_HYPERLINKS "body-hyperlinks"
#define EMPATHY_NOTIFY_MANAGER_CAP_BODY_IMAGES "body-images"
#define EMPATHY_NOTIFY_MANAGER_CAP_BODY_MARKUP "body-markup"
+#define EMPATHY_NOTIFY_MANAGER_CAP_CATEGORY "category"
#define EMPATHY_NOTIFY_MANAGER_CAP_ICON_MULTI "icon-multi"
#define EMPATHY_NOTIFY_MANAGER_CAP_ICON_STATIC "icon-static"
#define EMPATHY_NOTIFY_MANAGER_CAP_IMAGE_SVG_XML "image/svg+xml"
diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c
index 9f1774ae4..4bfe23cf1 100644
--- a/src/empathy-notifications-approver.c
+++ b/src/empathy-notifications-approver.c
@@ -244,6 +244,24 @@ notification_is_urgent (EmpathyNotificationsApprover *self,
return FALSE;
}
+static const gchar *
+get_category_for_event_type (EmpathyEventType type)
+{
+ switch (type) {
+ case EMPATHY_EVENT_TYPE_CHAT:
+ return "im.received";
+ case EMPATHY_EVENT_TYPE_VOIP:
+ case EMPATHY_EVENT_TYPE_TRANSFER:
+ case EMPATHY_EVENT_TYPE_INVITATION:
+ case EMPATHY_EVENT_TYPE_AUTH:
+ case EMPATHY_EVENT_TYPE_SUBSCRIPTION:
+ case EMPATHY_EVENT_TYPE_PRESENCE:
+ return NULL;
+ }
+
+ return NULL;
+}
+
static void
update_notification (EmpathyNotificationsApprover *self)
{
@@ -283,6 +301,8 @@ update_notification (EmpathyNotificationsApprover *self)
}
else
{
+ const gchar *category;
+
/* if the notification server supports x-canonical-append,
* the hint will be added, so that the message from the
* just created notification will be automatically appended
@@ -313,6 +333,11 @@ update_notification (EmpathyNotificationsApprover *self)
if (notification_is_urgent (self, notification))
notify_notification_set_urgency (notification, NOTIFY_URGENCY_CRITICAL);
+
+ category = get_category_for_event_type (self->priv->event->type);
+ if (category != NULL)
+ notify_notification_set_hint_string (notification,
+ EMPATHY_NOTIFY_MANAGER_CAP_CATEGORY, category);
}
pixbuf = empathy_notify_manager_get_pixbuf_for_notification (