aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-14 20:58:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-14 20:59:30 +0800
commit2734f01164697128745c9a16e417521cff7a9370 (patch)
tree920b56bd029b85d7d6e3fdfd1c1a50655fba0fe3 /libempathy
parenta551a0d1cdf34a3f36d21d235257a652db264f7e (diff)
downloadgsoc2013-empathy-2734f01164697128745c9a16e417521cff7a9370.tar
gsoc2013-empathy-2734f01164697128745c9a16e417521cff7a9370.tar.gz
gsoc2013-empathy-2734f01164697128745c9a16e417521cff7a9370.tar.bz2
gsoc2013-empathy-2734f01164697128745c9a16e417521cff7a9370.tar.lz
gsoc2013-empathy-2734f01164697128745c9a16e417521cff7a9370.tar.xz
gsoc2013-empathy-2734f01164697128745c9a16e417521cff7a9370.tar.zst
gsoc2013-empathy-2734f01164697128745c9a16e417521cff7a9370.zip
No need to get RequestableChannelClasses if ContactCapability is implemented
We use it only as a fallback if it's not.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-factory.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index e7220d630..4d5a7295e 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -52,6 +52,9 @@ typedef struct {
guint avatar_max_width;
guint avatar_max_height;
guint avatar_max_size;
+ /* can_request_ft and can_request_st are meaningful only if the connection
+ * doesn't implement ContactCapabilities. If it's implemented, we use it to
+ * check if contacts support file transfer and stream tubes. */
gboolean can_request_ft;
gboolean can_request_st;
/* TRUE if ContactCapabilities is implemented by the Connection */
@@ -701,12 +704,17 @@ get_requestable_channel_classes_cb (TpProxy *connection,
classes = g_value_get_boxed (value);
+ DEBUG ("ContactCapabilities is not implemented; use RCC");
capabilities = channel_classes_to_capabilities (classes, FALSE);
- if ((capabilities & EMPATHY_CAPABILITIES_FT) != 0)
+ if ((capabilities & EMPATHY_CAPABILITIES_FT) != 0) {
+ DEBUG ("Assume all contacts support FT as CM implements it");
priv->can_request_ft = TRUE;
+ }
- if ((capabilities & EMPATHY_CAPABILITIES_STREAM_TUBE) != 0)
+ if ((capabilities & EMPATHY_CAPABILITIES_STREAM_TUBE) != 0) {
+ DEBUG ("Assume all contacts support stream tubes as CM implements them");
priv->can_request_st = TRUE;
+ }
if (!priv->can_request_ft && !priv->can_request_st)
return ;
@@ -718,15 +726,13 @@ get_requestable_channel_classes_cb (TpProxy *connection,
caps = empathy_contact_get_capabilities (contact);
- 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;
+ /* 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;
- }
+ if (priv->can_request_st)
+ caps |= EMPATHY_CAPABILITIES_STREAM_TUBE;
empathy_contact_set_capabilities (contact, caps);
}
@@ -1466,11 +1472,13 @@ connection_ready_cb (TpConnection *connection,
NULL, NULL,
G_OBJECT (tp_factory));
- tp_cli_dbus_properties_call_get (priv->connection, -1,
- TP_IFACE_CONNECTION_INTERFACE_REQUESTS,
- "RequestableChannelClasses",
- get_requestable_channel_classes_cb, NULL, NULL,
- G_OBJECT (tp_factory));
+ if (!priv->contact_caps_supported) {
+ tp_cli_dbus_properties_call_get (priv->connection, -1,
+ TP_IFACE_CONNECTION_INTERFACE_REQUESTS,
+ "RequestableChannelClasses",
+ get_requestable_channel_classes_cb, NULL, NULL,
+ G_OBJECT (tp_factory));
+ }
out:
g_object_unref (tp_factory);