[empathy] set a category on presence notifications



commit c81f08fb5baebdd855089f05828f1c68fbc74893
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 30 09:51:29 2011 +0200

    set a category on presence notifications

 src/empathy-event-manager.c          |    6 ++++--
 src/empathy-event-manager.h          |    3 ++-
 src/empathy-notifications-approver.c |    8 ++++++--
 3 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index e2ad93d..342d3e1 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -1121,7 +1121,8 @@ event_manager_presence_changed_cb (EmpathyContact *contact,
                 EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNOUT))
             {
               event_manager_add (manager, NULL, contact,
-                  EMPATHY_EVENT_TYPE_PRESENCE, EMPATHY_IMAGE_AVATAR_DEFAULT,
+                  EMPATHY_EVENT_TYPE_PRESENCE_OFFLINE,
+                  EMPATHY_IMAGE_AVATAR_DEFAULT,
                   empathy_contact_get_alias (contact), _("Disconnected"),
                   NULL, NULL, NULL);
             }
@@ -1141,7 +1142,8 @@ event_manager_presence_changed_cb (EmpathyContact *contact,
                 EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNIN))
             {
               event_manager_add (manager, NULL, contact,
-                  EMPATHY_EVENT_TYPE_PRESENCE, EMPATHY_IMAGE_AVATAR_DEFAULT,
+                  EMPATHY_EVENT_TYPE_PRESENCE_ONLINE,
+                  EMPATHY_IMAGE_AVATAR_DEFAULT,
                   empathy_contact_get_alias (contact), _("Connected"),
                   NULL, NULL, NULL);
             }
diff --git a/src/empathy-event-manager.h b/src/empathy-event-manager.h
index 16d97c6..c8b032a 100644
--- a/src/empathy-event-manager.h
+++ b/src/empathy-event-manager.h
@@ -53,7 +53,8 @@ typedef enum {
     EMPATHY_EVENT_TYPE_VOIP,
     EMPATHY_EVENT_TYPE_TRANSFER,
     EMPATHY_EVENT_TYPE_SUBSCRIPTION,
-    EMPATHY_EVENT_TYPE_PRESENCE,
+    EMPATHY_EVENT_TYPE_PRESENCE_ONLINE,
+    EMPATHY_EVENT_TYPE_PRESENCE_OFFLINE,
     EMPATHY_EVENT_TYPE_INVITATION,
     EMPATHY_EVENT_TYPE_AUTH,
 } EmpathyEventType;
diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c
index 4bfe23c..af07447 100644
--- a/src/empathy-notifications-approver.c
+++ b/src/empathy-notifications-approver.c
@@ -237,7 +237,8 @@ notification_is_urgent (EmpathyNotificationsApprover *self,
       return TRUE;
 
     case EMPATHY_EVENT_TYPE_SUBSCRIPTION:
-    case EMPATHY_EVENT_TYPE_PRESENCE:
+    case EMPATHY_EVENT_TYPE_PRESENCE_ONLINE:
+    case EMPATHY_EVENT_TYPE_PRESENCE_OFFLINE:
       return FALSE;
   }
 
@@ -250,12 +251,15 @@ get_category_for_event_type (EmpathyEventType type)
   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_TRANSFER:
     case EMPATHY_EVENT_TYPE_INVITATION:
     case EMPATHY_EVENT_TYPE_AUTH:
     case EMPATHY_EVENT_TYPE_SUBSCRIPTION:
-    case EMPATHY_EVENT_TYPE_PRESENCE:
       return NULL;
   }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]