aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-13 21:55:24 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-14 20:59:29 +0800
commitaf80a92b8af244fff6567706d8a79010e2c21cc7 (patch)
tree59a0c29a57efe2eaafcfc529913310d391f8f6aa /libempathy
parent49c0ca0a3327016e3b4b64490c6494ef0383ce7e (diff)
downloadgsoc2013-empathy-af80a92b8af244fff6567706d8a79010e2c21cc7.tar
gsoc2013-empathy-af80a92b8af244fff6567706d8a79010e2c21cc7.tar.gz
gsoc2013-empathy-af80a92b8af244fff6567706d8a79010e2c21cc7.tar.bz2
gsoc2013-empathy-af80a92b8af244fff6567706d8a79010e2c21cc7.tar.lz
gsoc2013-empathy-af80a92b8af244fff6567706d8a79010e2c21cc7.tar.xz
gsoc2013-empathy-af80a92b8af244fff6567706d8a79010e2c21cc7.tar.zst
gsoc2013-empathy-af80a92b8af244fff6567706d8a79010e2c21cc7.zip
Don't assume contacts support FT if ContactCapabilities is implemented
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-factory.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index 1a8d5fbdc..80eaaa963 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -54,6 +54,8 @@ typedef struct {
guint avatar_max_size;
gboolean can_request_ft;
gboolean can_request_st;
+ /* TRUE if ContactCapabilities is implemented by the Connection */
+ gboolean contact_caps_supported;
} EmpathyTpContactFactoryPriv;
G_DEFINE_TYPE (EmpathyTpContactFactory, empathy_tp_contact_factory, G_TYPE_OBJECT);
@@ -684,8 +686,12 @@ get_requestable_channel_classes_cb (TpProxy *connection,
caps = empathy_contact_get_capabilities (contact);
- if (priv->can_request_ft)
- caps |= EMPATHY_CAPABILITIES_FT;
+ if (!priv->contact_caps_supported) {
+ /* ContactCapabilities is not supported; assume all contacts can do file
+ * transfer if it's implemented in the CM */
+ if (priv->can_request_ft)
+ caps |= EMPATHY_CAPABILITIES_FT;
+ }
if (priv->can_request_st)
caps |= EMPATHY_CAPABILITIES_STREAM_TUBE;
@@ -748,8 +754,12 @@ tp_contact_factory_add_contact (EmpathyTpContactFactory *tp_factory,
caps = empathy_contact_get_capabilities (contact);
/* Set the FT capability */
- if (priv->can_request_ft) {
- caps |= EMPATHY_CAPABILITIES_FT;
+ if (!priv->contact_caps_supported) {
+ /* ContactCapabilities is not supported; assume all contacts can do file
+ * transfer if it's implemented in the CM */
+ if (priv->can_request_ft) {
+ caps |= EMPATHY_CAPABILITIES_FT;
+ }
}
/* Set the Stream Tube capability */
@@ -1342,6 +1352,10 @@ connection_ready_cb (TpConnection *connection,
G_OBJECT (tp_factory),
NULL);
+ if (tp_proxy_has_interface_by_id (connection,
+ TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES)) {
+ priv->contact_caps_supported = TRUE;
+ }
tp_cli_connection_interface_avatars_call_get_avatar_requirements (priv->connection,
-1,
@@ -1474,6 +1488,7 @@ empathy_tp_contact_factory_init (EmpathyTpContactFactory *tp_factory)
tp_factory->priv = priv;
priv->can_request_ft = FALSE;
priv->can_request_st = FALSE;
+ priv->contact_caps_supported = FALSE;
}
static GHashTable *factories = NULL;