aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-28 19:48:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-28 19:48:38 +0800
commitba3ffc72a2b424eaa79a94e6a2390b0b5858b867 (patch)
tree01a0dc218d436b83e245501b0a14f2d31a1e5484 /src
parent98724dbfa33099bba07ba8951950a14303e763cc (diff)
parented85fe70b223a778b5d7bdca6b4fe8d5ac327959 (diff)
downloadgsoc2013-empathy-ba3ffc72a2b424eaa79a94e6a2390b0b5858b867.tar
gsoc2013-empathy-ba3ffc72a2b424eaa79a94e6a2390b0b5858b867.tar.gz
gsoc2013-empathy-ba3ffc72a2b424eaa79a94e6a2390b0b5858b867.tar.bz2
gsoc2013-empathy-ba3ffc72a2b424eaa79a94e6a2390b0b5858b867.tar.lz
gsoc2013-empathy-ba3ffc72a2b424eaa79a94e6a2390b0b5858b867.tar.xz
gsoc2013-empathy-ba3ffc72a2b424eaa79a94e6a2390b0b5858b867.tar.zst
gsoc2013-empathy-ba3ffc72a2b424eaa79a94e6a2390b0b5858b867.zip
Merge remote-tracking branch 'wjt/652800-661731-notifications'
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-window.c11
-rw-r--r--src/empathy-event-manager.h1
-rw-r--r--src/empathy-notifications-approver.c35
3 files changed, 25 insertions, 22 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index f80f09611..ac3584f34 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)
+ ? EMPATHY_NOTIFICATION_CATEGORY_MENTIONED
+ : EMPATHY_NOTIFICATION_CATEGORY_CHAT;
+ 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,
diff --git a/src/empathy-event-manager.h b/src/empathy-event-manager.h
index 91c6e1f99..e50ab8884 100644
--- a/src/empathy-event-manager.h
+++ b/src/empathy-event-manager.h
@@ -58,6 +58,7 @@ typedef enum {
EMPATHY_EVENT_TYPE_PRESENCE_OFFLINE,
EMPATHY_EVENT_TYPE_INVITATION,
EMPATHY_EVENT_TYPE_AUTH,
+ EMPATHY_EVENT_TYPE_MENTIONED,
} EmpathyEventType;
typedef struct {
diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c
index 7a4f03731..92b3f7475 100644
--- a/src/empathy-notifications-approver.c
+++ b/src/empathy-notifications-approver.c
@@ -185,6 +185,7 @@ add_notification_actions (EmpathyNotificationsApprover *self,
switch (self->priv->event->type) {
case EMPATHY_EVENT_TYPE_CHAT:
+ case EMPATHY_EVENT_TYPE_MENTIONED:
notify_notification_add_action (notification,
"respond", _("Respond"), (NotifyActionCallback) notification_approve_cb,
self, NULL);
@@ -265,6 +266,7 @@ notification_is_urgent (EmpathyNotificationsApprover *self,
case EMPATHY_EVENT_TYPE_TRANSFER:
case EMPATHY_EVENT_TYPE_INVITATION:
case EMPATHY_EVENT_TYPE_AUTH:
+ case EMPATHY_EVENT_TYPE_MENTIONED:
return TRUE;
case EMPATHY_EVENT_TYPE_SUBSCRIPTION:
@@ -276,30 +278,25 @@ notification_is_urgent (EmpathyNotificationsApprover *self,
return FALSE;
}
-/* Use x-empathy as prefix for unofficial categories
- * http://www.galago-project.org/specs/notification/0.9/x211.html */
static const gchar *
get_category_for_event_type (EmpathyEventType type)
{
+#define CASE(x) \
+ case EMPATHY_EVENT_TYPE_##x: \
+ return EMPATHY_NOTIFICATION_CATEGORY_##x;
switch (type) {
- case EMPATHY_EVENT_TYPE_CHAT:
- return "im.received";
- case EMPATHY_EVENT_TYPE_PRESENCE_ONLINE:
- return "presence.online";
- case EMPATHY_EVENT_TYPE_PRESENCE_OFFLINE:
- return "presence.offline";
- case EMPATHY_EVENT_TYPE_VOIP:
- case EMPATHY_EVENT_TYPE_CALL:
- return "x-empathy.call.incoming";
- case EMPATHY_EVENT_TYPE_TRANSFER:
- return "x-empathy.transfer.incoming";
- case EMPATHY_EVENT_TYPE_INVITATION:
- return "x-empathy.im.room-invitation";
- case EMPATHY_EVENT_TYPE_AUTH:
- return "x-empathy.network.auth-request";
- case EMPATHY_EVENT_TYPE_SUBSCRIPTION:
- return "x-empathy.im.subscription-request";
+ CASE(CHAT)
+ CASE(PRESENCE_ONLINE)
+ CASE(PRESENCE_OFFLINE)
+ CASE(VOIP)
+ CASE(CALL)
+ CASE(TRANSFER)
+ CASE(INVITATION)
+ CASE(AUTH)
+ CASE(SUBSCRIPTION)
+ CASE(MENTIONED)
}
+#undef CASE
return NULL;
}