empathy r1830 - trunk/libempathy



Author: xclaesse
Date: Fri Nov 21 16:19:41 2008
New Revision: 1830
URL: http://svn.gnome.org/viewvc/empathy?rev=1830&view=rev

Log:
Moved capabilities hack to empathy_contact_set_account. (Jonny Lamb)

Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>

Modified:
   trunk/libempathy/empathy-contact.c

Modified: trunk/libempathy/empathy-contact.c
==============================================================================
--- trunk/libempathy/empathy-contact.c	(original)
+++ trunk/libempathy/empathy-contact.c	Fri Nov 21 16:19:41 2008
@@ -468,6 +468,20 @@
   return priv->account;
 }
 
+static gboolean
+contact_is_salut (EmpathyContact *contact)
+{
+  McAccount *account;
+  McProfile *profile;
+  const gchar *name;
+
+  account = empathy_contact_get_account (contact);
+  profile = mc_account_get_profile (account);
+  name = mc_profile_get_protocol_name (profile);
+
+  return (strcmp (name, "local-xmpp") == 0);
+}
+
 void
 empathy_contact_set_account (EmpathyContact *contact,
                              McAccount *account)
@@ -486,6 +500,19 @@
       g_object_unref (priv->account);
   priv->account = g_object_ref (account);
 
+  /* FIXME salut does not yet support the Capabilities interface, so for
+   * now we use this hack.
+   */
+  if (contact_is_salut (contact))
+    {
+      EmpathyCapabilities caps;
+
+      caps = empathy_contact_get_capabilities (contact);
+      caps |= EMPATHY_CAPABILITIES_FT;
+
+      empathy_contact_set_capabilities (contact, caps);
+    }
+
   g_object_notify (G_OBJECT (contact), "account");
 }
 
@@ -560,20 +587,6 @@
   return priv->handle;
 }
 
-static gboolean
-contact_is_salut (EmpathyContact *contact)
-{
-  McAccount *account;
-  McProfile *profile;
-  const gchar *name;
-
-  account = empathy_contact_get_account (contact);
-  profile = mc_account_get_profile (account);
-  name = mc_profile_get_protocol_name (profile);
-
-  return (strcmp (name, "local-xmpp") == 0);
-}
-
 void
 empathy_contact_set_handle (EmpathyContact *contact,
                             guint handle)
@@ -589,19 +602,6 @@
     {
       priv->handle = handle;
       g_object_notify (G_OBJECT (contact), "handle");
-
-      /* FIXME salut does not yet support the Capabilities interface, so for
-       * now we use this hack.
-       */
-      if (contact_is_salut (contact))
-        {
-          EmpathyCapabilities caps;
-
-          caps = empathy_contact_get_capabilities (contact);
-          caps |= EMPATHY_CAPABILITIES_FT;
-
-          empathy_contact_set_capabilities (contact, caps);
-        }
     }
   contact_set_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]