]> git.0d.be Git - empathy.git/commitdiff
Moved capabilities hack to empathy_contact_set_account. (Jonny Lamb)
authorJonny Lamb <jonny.lamb@collabora.co.uk>
Fri, 21 Nov 2008 16:19:41 +0000 (16:19 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 21 Nov 2008 16:19:41 +0000 (16:19 +0000)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1830

libempathy/empathy-contact.c

index 8768c40462076d715068ca4c0da459e58e2f323b..d2c187a1d5deca52db4c7b8b607e4ef2e82e11db 100644 (file)
@@ -468,6 +468,20 @@ empathy_contact_get_account (EmpathyContact *contact)
   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 @@ empathy_contact_set_account (EmpathyContact *contact,
       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 @@ empathy_contact_get_handle (EmpathyContact *contact)
   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 @@ empathy_contact_set_handle (EmpathyContact *contact,
     {
       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);