empathy r2719 - trunk/libempathy



Author: xclaesse
Date: Fri Mar 20 10:14:58 2009
New Revision: 2719
URL: http://svn.gnome.org/viewvc/empathy?rev=2719&view=rev

Log:
empathy_contact_set_handle: remove the handle ready flag when the handle is set to 0

From: Guillaume Desmottes <gdesmott gnome org>

Modified:
   trunk/libempathy/empathy-contact.c

Modified: trunk/libempathy/empathy-contact.c
==============================================================================
--- trunk/libempathy/empathy-contact.c	(original)
+++ trunk/libempathy/empathy-contact.c	Fri Mar 20 10:14:58 2009
@@ -456,6 +456,19 @@
     }
 }
 
+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 @@
       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);
 }
 



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