aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2013-07-18 17:13:48 +0800
committerXavier Claessens <xavier.claessens@collabora.co.uk>2013-07-18 19:02:17 +0800
commit2d71ae69bc60d3825feafb0e2315069498010aee (patch)
tree1d82c20c50c94cf4ca7df40a6d4a5490e6f25d81
parentafb3644656e56aaefd56f8ec822472ab8c5d5239 (diff)
downloadgsoc2013-empathy-2d71ae69bc60d3825feafb0e2315069498010aee.tar
gsoc2013-empathy-2d71ae69bc60d3825feafb0e2315069498010aee.tar.gz
gsoc2013-empathy-2d71ae69bc60d3825feafb0e2315069498010aee.tar.bz2
gsoc2013-empathy-2d71ae69bc60d3825feafb0e2315069498010aee.tar.lz
gsoc2013-empathy-2d71ae69bc60d3825feafb0e2315069498010aee.tar.xz
gsoc2013-empathy-2d71ae69bc60d3825feafb0e2315069498010aee.tar.zst
gsoc2013-empathy-2d71ae69bc60d3825feafb0e2315069498010aee.zip
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
-rw-r--r--src/empathy-event-manager.c19
1 files changed, 16 insertions, 3 deletions
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);