aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-notifications-approver.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-03-28 17:39:51 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2012-03-28 17:41:57 +0800
commited85fe70b223a778b5d7bdca6b4fe8d5ac327959 (patch)
tree636c97a08143b39440a226efdc96159ba67f7a0c /src/empathy-notifications-approver.c
parent9420ba8ea42efb6d5e1e044d68cc1ba571120314 (diff)
downloadgsoc2013-empathy-ed85fe70b223a778b5d7bdca6b4fe8d5ac327959.tar
gsoc2013-empathy-ed85fe70b223a778b5d7bdca6b4fe8d5ac327959.tar.gz
gsoc2013-empathy-ed85fe70b223a778b5d7bdca6b4fe8d5ac327959.tar.bz2
gsoc2013-empathy-ed85fe70b223a778b5d7bdca6b4fe8d5ac327959.tar.lz
gsoc2013-empathy-ed85fe70b223a778b5d7bdca6b4fe8d5ac327959.tar.xz
gsoc2013-empathy-ed85fe70b223a778b5d7bdca6b4fe8d5ac327959.tar.zst
gsoc2013-empathy-ed85fe70b223a778b5d7bdca6b4fe8d5ac327959.zip
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.
Diffstat (limited to 'src/empathy-notifications-approver.c')
-rw-r--r--src/empathy-notifications-approver.c35
1 files changed, 16 insertions, 19 deletions
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;
}