From 7326d5191994ee88d889b5c33e34fc4d341cad63 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Fri, 21 Nov 2008 16:19:41 +0000 Subject: Moved capabilities hack to empathy_contact_set_account. (Jonny Lamb) Signed-off-by: Jonny Lamb svn path=/trunk/; revision=1830 --- libempathy/empathy-contact.c | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'libempathy') 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); -- cgit v1.2.3