empathy r2720 - branches/gnome-2-26/libempathy



Author: xclaesse
Date: Fri Mar 20 10:15:49 2009
New Revision: 2720
URL: http://svn.gnome.org/viewvc/empathy?rev=2720&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:
   branches/gnome-2-26/libempathy/empathy-contact.c

Modified: branches/gnome-2-26/libempathy/empathy-contact.c
==============================================================================
--- branches/gnome-2-26/libempathy/empathy-contact.c	(original)
+++ branches/gnome-2-26/libempathy/empathy-contact.c	Fri Mar 20 10:15:49 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]