summaryrefslogtreecommitdiff
path: root/src/protocol.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-17 14:08:59 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-18 13:20:35 +0200
commitd9dd5549573b1423a117744cc4d7573de6619b34 (patch)
treebf60d93f9a9844d39546891607890fbce0213e9d /src/protocol.c
parentcc57a8a5138386ba7658d46dd7f0b46e2533c7c1 (diff)
downloadtelepathy-haze-d9dd5549573b1423a117744cc4d7573de6619b34.tar.gz
protocol: claim that we implement Avatars
Diffstat (limited to 'src/protocol.c')
-rw-r--r--src/protocol.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c
index e0a7b46..9089e0d 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -885,11 +885,28 @@ haze_protocol_identify_account (TpBaseProtocol *base,
static GPtrArray *
haze_protocol_get_interfaces_array (TpBaseProtocol *base)
{
+ HazeProtocol *self = HAZE_PROTOCOL (base);
GPtrArray *interfaces;
+ GPtrArray *tmp;
+ guint i;
interfaces = TP_BASE_PROTOCOL_CLASS (
haze_protocol_parent_class)->get_interfaces_array (base);
+ /* Claim to implement Avatars only if we support avatars for this
+ * protocol. */
+ tmp = haze_connection_dup_implemented_interfaces (self->priv->prpl_info);
+ for (i = 0; i < tmp->len; i++)
+ {
+ if (!tp_strdiff (g_ptr_array_index (tmp, i),
+ TP_IFACE_CONNECTION_INTERFACE_AVATARS))
+ {
+ g_ptr_array_add (interfaces, TP_IFACE_PROTOCOL_INTERFACE_AVATARS);
+ break;
+ }
+ }
+ g_ptr_array_unref (tmp);
+
return interfaces;
}