summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-18 10:44:46 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-18 10:44:46 +0200
commitfa4ff01a9cbc5ef5539ab07c52f3053d0b53c705 (patch)
tree96c956c149bec782a13ff732f8fd2dca4e097234 /src
parentc96e94a66f65ef87054c0e2632748472f652ce2d (diff)
protocol: implement get_avatar_details()
Diffstat (limited to 'src')
-rw-r--r--src/conn-avatars.c34
-rw-r--r--src/conn-avatars.h9
-rw-r--r--src/protocol.c17
3 files changed, 60 insertions, 0 deletions
diff --git a/src/conn-avatars.c b/src/conn-avatars.c
index a90555113..681a04df4 100644
--- a/src/conn-avatars.c
+++ b/src/conn-avatars.c
@@ -991,3 +991,37 @@ conn_avatars_properties_getter (GObject *object,
g_value_set_uint (value, GPOINTER_TO_UINT (getter_data));
}
}
+
+void
+gabble_connection_dup_avatar_requirements (GStrv *supported_mime_types,
+ guint *min_height,
+ guint *min_width,
+ guint *rec_height,
+ guint *rec_width,
+ guint *max_height,
+ guint *max_width,
+ guint *max_bytes)
+{
+ if (supported_mime_types != NULL)
+ {
+ *supported_mime_types = g_strdupv ((gchar **) mimetypes);
+ }
+
+ if (min_height != NULL)
+ *min_height = AVATAR_MIN_PX;
+ if (min_width != NULL)
+ *min_width = AVATAR_MIN_PX;
+
+ if (rec_height != NULL)
+ *rec_height = AVATAR_REC_PX;
+ if (rec_width != NULL)
+ *rec_width = AVATAR_REC_PX;
+
+ if (max_height != NULL)
+ *max_height = AVATAR_MAX_PX;
+ if (max_width != NULL)
+ *max_width = AVATAR_MAX_PX;
+
+ if (max_bytes != NULL)
+ *max_bytes = AVATAR_MAX_BYTES;
+}
diff --git a/src/conn-avatars.h b/src/conn-avatars.h
index 0e2899f24..a26506d0c 100644
--- a/src/conn-avatars.h
+++ b/src/conn-avatars.h
@@ -32,6 +32,15 @@ extern TpDBusPropertiesMixinPropImpl *conn_avatars_properties;
void conn_avatars_properties_getter (GObject *object, GQuark interface,
GQuark name, GValue *value, gpointer getter_data);
+void gabble_connection_dup_avatar_requirements (GStrv *supported_mime_types,
+ guint *min_height,
+ guint *min_width,
+ guint *rec_height,
+ guint *rec_width,
+ guint *max_height,
+ guint *max_width,
+ guint *max_bytes);
+
G_END_DECLS
#endif /* __CONN_AVATARS_H__ */
diff --git a/src/protocol.c b/src/protocol.c
index 22b844468..d89b8a11b 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -30,6 +30,7 @@
#include "extensions/extensions.h"
+#include "conn-avatars.h"
#include "conn-presence.h"
#include "connection.h"
@@ -455,6 +456,21 @@ addressing_normalize_contact_uri (TpBaseProtocol *self,
}
static void
+get_avatar_details (TpBaseProtocol *base,
+ GStrv *supported_mime_types,
+ guint *min_height,
+ guint *min_width,
+ guint *rec_height,
+ guint *rec_width,
+ guint *max_height,
+ guint *max_width,
+ guint *max_bytes)
+{
+ gabble_connection_dup_avatar_requirements (supported_mime_types, min_height,
+ min_width, rec_height, rec_width, max_height, max_width, max_bytes);
+}
+
+static void
gabble_jabber_protocol_class_init (GabbleJabberProtocolClass *klass)
{
TpBaseProtocolClass *base_class =
@@ -468,6 +484,7 @@ gabble_jabber_protocol_class_init (GabbleJabberProtocolClass *klass)
base_class->get_connection_details = get_connection_details;
base_class->get_statuses = get_presence_statuses;
base_class->dup_authentication_types = dup_authentication_types;
+ base_class->get_avatar_details = get_avatar_details;
}
TpBaseProtocol *