aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <gdesmott@gnome.org>2009-03-20 18:14:58 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-03-20 18:14:58 +0800
commit87cafb1df56b5eca945b28f89a441c05e3aef537 (patch)
treeeb198f6dcf5cad600c26593ad3b0e476708bc7c2 /libempathy
parent2b2b12f175f8988fea2e885bae74cbe7e113fc0a (diff)
downloadgsoc2013-empathy-87cafb1df56b5eca945b28f89a441c05e3aef537.tar
gsoc2013-empathy-87cafb1df56b5eca945b28f89a441c05e3aef537.tar.gz
gsoc2013-empathy-87cafb1df56b5eca945b28f89a441c05e3aef537.tar.bz2
gsoc2013-empathy-87cafb1df56b5eca945b28f89a441c05e3aef537.tar.lz
gsoc2013-empathy-87cafb1df56b5eca945b28f89a441c05e3aef537.tar.xz
gsoc2013-empathy-87cafb1df56b5eca945b28f89a441c05e3aef537.tar.zst
gsoc2013-empathy-87cafb1df56b5eca945b28f89a441c05e3aef537.zip
empathy_contact_set_handle: remove the handle ready flag when the handle is set to 0
From: Guillaume Desmottes <gdesmott@gnome.org> svn path=/trunk/; revision=2719
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 59d55fd4d..1cac48513 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -456,6 +456,19 @@ contact_set_ready_flag (EmpathyContact *contact,
}
}
+static void
+contact_remove_ready_flag (EmpathyContact *contact,
+ EmpathyContactReady flag)
+{
+ EmpathyContactPriv *priv = GET_PRIV (contact);
+
+ if (priv->ready & flag)
+ {
+ priv->ready ^= flag;
+ g_object_notify (G_OBJECT (contact), "ready");
+ }
+}
+
EmpathyContact *
empathy_contact_new (McAccount *account)
{
@@ -713,7 +726,12 @@ empathy_contact_set_handle (EmpathyContact *contact,
priv->handle = handle;
g_object_notify (G_OBJECT (contact), "handle");
}
- contact_set_ready_flag (contact, EMPATHY_CONTACT_READY_HANDLE);
+
+ if (handle != 0)
+ contact_set_ready_flag (contact, EMPATHY_CONTACT_READY_HANDLE);
+ else
+ contact_remove_ready_flag (contact, EMPATHY_CONTACT_READY_HANDLE);
+
g_object_unref (contact);
}