diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-11-22 00:13:20 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:13:20 +0800 |
commit | 8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7 (patch) | |
tree | a903522179edd9915b695d35b057f3767031f44b /libempathy/empathy-contact.c | |
parent | accb59c6905838d833fcc9655d31d63a459ce8a5 (diff) | |
download | gsoc2013-empathy-8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7.tar gsoc2013-empathy-8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7.tar.gz gsoc2013-empathy-8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7.tar.bz2 gsoc2013-empathy-8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7.tar.lz gsoc2013-empathy-8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7.tar.xz gsoc2013-empathy-8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7.tar.zst gsoc2013-empathy-8fbb7352b2575ab85c0706f7b8b3347b7b3c8fe7.zip |
Added ft-related functions to EmpathyContact. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1733
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r-- | libempathy/empathy-contact.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 6aed12acc..7c8539fba 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -560,6 +560,20 @@ empathy_contact_get_handle (EmpathyContact *contact) return priv->handle; } +static gboolean +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) @@ -575,6 +589,19 @@ 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 (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); @@ -680,6 +707,18 @@ empathy_contact_can_voip (EmpathyContact *contact) EMPATHY_CAPABILITIES_VIDEO); } +gboolean +empathy_contact_can_send_files (EmpathyContact *contact) +{ + EmpathyContactPriv *priv; + + g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), FALSE); + + priv = GET_PRIV (contact); + + return priv->capabilities & EMPATHY_CAPABILITIES_FT; +} + EmpathyContactReady empathy_contact_get_ready (EmpathyContact *contact) { |