[empathy] EmpathyEventManager: Do not miss contact signon even for new contacts



commit 2d71ae69bc60d3825feafb0e2315069498010aee
Author: Xavier Claessens <xavier claessens collabora co uk>
Date:   Thu Jul 18 11:13:48 2013 +0200

    EmpathyEventManager: Do not miss contact signon even for new contacts
    
    When a new contact is added, it could already be online,
    especially with Salut.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704452

 src/empathy-event-manager.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index a017185..ea9ebc6 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -1123,10 +1123,10 @@ event_manager_publish_state_changed_cb (TpContact *contact,
 }
 
 static void
-event_manager_presence_changed_cb (EmpathyContact *contact,
+check_presence (EmpathyEventManager *manager,
+    EmpathyContact *contact,
     TpConnectionPresenceType current,
-    TpConnectionPresenceType previous,
-    EmpathyEventManager *manager)
+    TpConnectionPresenceType previous)
 {
   EmpathyEventManagerPriv *priv = GET_PRIV (manager);
   TpAccount *account;
@@ -1186,6 +1186,15 @@ out:
   g_object_unref (presence_mgr);
 }
 
+static void
+event_manager_presence_changed_cb (EmpathyContact *contact,
+    TpConnectionPresenceType current,
+    TpConnectionPresenceType previous,
+    EmpathyEventManager *manager)
+{
+  check_presence (manager, contact, current, previous);
+}
+
 static GObject *
 event_manager_constructor (GType type,
                           guint n_props,
@@ -1288,6 +1297,10 @@ contact_list_changed_cb (EmpathyConnectionAggregator *aggregator,
       tp_g_signal_connect_object (contact, "presence-changed",
           G_CALLBACK (event_manager_presence_changed_cb), self, 0);
 
+      check_presence (self, contact,
+          empathy_contact_get_presence (contact),
+          TP_CONNECTION_PRESENCE_TYPE_OFFLINE);
+
       tp_g_signal_connect_object (tp_contact, "notify::publish-state",
           G_CALLBACK (event_manager_publish_state_changed_cb), self, 0);
 


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