From 2d71ae69bc60d3825feafb0e2315069498010aee Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 18 Jul 2013 11:13:48 +0200 Subject: 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 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index a0171858a..ea9ebc697 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); -- cgit v1.2.3