From 9420ba8ea42efb6d5e1e044d68cc1ba571120314 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Wed, 28 Mar 2012 10:06:14 +0100 Subject: Show MUC highlight notifications in Gnome Shell Gnome Shell filters out notifications from Empathy whose category is something the Shell shows its own notification for. However, we previously used the im.received category for notifications about being highlighted in a MUC, as well as for incoming 1-1 IM notifications. The Shell filters these out these notifications, because it shows its own 1-1 notifications, but it doesn't show MUC highlight notifications. So this patch sets a different category on notifications from chat rooms, which makes them show up in Gnome Shell. I'm prefixing the category with x-empathy, following the comment above get_category_for_event_type in empathy-notifications-approver.c. This shouldn't confuse other notification daemons, unless they were also filtering out im.received but also showed their own highlight notifications (which I find unlikely). https://bugzilla.gnome.org/show_bug.cgi?id=652800 --- src/empathy-chat-window.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/empathy-chat-window.c') diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index f80f09611..0008fed38 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1568,9 +1568,14 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window, EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND, "1"); } - notify_notification_set_hint (notification, - EMPATHY_NOTIFY_MANAGER_CAP_CATEGORY, - g_variant_new_string ("im.received")); + { + const gchar *category = empathy_chat_is_room (chat) + ? "x-empathy.im.mentioned" + : "im.received"; + notify_notification_set_hint (notification, + EMPATHY_NOTIFY_MANAGER_CAP_CATEGORY, + g_variant_new_string (category)); + } } pixbuf = empathy_notify_manager_get_pixbuf_for_notification (priv->notify_mgr, -- cgit v1.2.3 From ed85fe70b223a778b5d7bdca6b4fe8d5ac327959 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Wed, 28 Mar 2012 10:39:51 +0100 Subject: Move category name constants to #defines This is kind of overkill to avoid me typoing the two names used in empathy-chat-window.c, but, hey. --- src/empathy-chat-window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/empathy-chat-window.c') diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 0008fed38..ac3584f34 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1570,8 +1570,8 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window, { const gchar *category = empathy_chat_is_room (chat) - ? "x-empathy.im.mentioned" - : "im.received"; + ? EMPATHY_NOTIFICATION_CATEGORY_MENTIONED + : EMPATHY_NOTIFICATION_CATEGORY_CHAT; notify_notification_set_hint (notification, EMPATHY_NOTIFY_MANAGER_CAP_CATEGORY, g_variant_new_string (category)); -- cgit v1.2.3