aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2008-11-22 00:19:41 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-11-22 00:19:41 +0800
commit7326d5191994ee88d889b5c33e34fc4d341cad63 (patch)
treeec1f793ce2d8abefb855cba05439534edba160d0 /libempathy/empathy-contact.c
parent93ea221b297a0e46380029035b32551af0b36202 (diff)
downloadgsoc2013-empathy-7326d5191994ee88d889b5c33e34fc4d341cad63.tar
gsoc2013-empathy-7326d5191994ee88d889b5c33e34fc4d341cad63.tar.gz
gsoc2013-empathy-7326d5191994ee88d889b5c33e34fc4d341cad63.tar.bz2
gsoc2013-empathy-7326d5191994ee88d889b5c33e34fc4d341cad63.tar.lz
gsoc2013-empathy-7326d5191994ee88d889b5c33e34fc4d341cad63.tar.xz
gsoc2013-empathy-7326d5191994ee88d889b5c33e34fc4d341cad63.tar.zst
gsoc2013-empathy-7326d5191994ee88d889b5c33e34fc4d341cad63.zip
Moved capabilities hack to empathy_contact_set_account. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> svn path=/trunk/; revision=1830
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r--libempathy/empathy-contact.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 8768c4046..d2c187a1d 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -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);