From 93fa6f4eeb668896c683e928845eabafc8106a62 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 19 Sep 2013 12:02:45 +0200 Subject: protocol: implement get_avatar_details() https://bugs.freedesktop.org/show_bug.cgi?id=69508 --- src/connection.c | 34 ++++++++++++++++++++++++++++++++++ src/connection.h | 9 +++++++++ src/protocol.c | 16 ++++++++++++++++ 3 files changed, 59 insertions(+) (limited to 'src') diff --git a/src/connection.c b/src/connection.c index 4886414c..186997bd 100644 --- a/src/connection.c +++ b/src/connection.c @@ -4169,3 +4169,37 @@ salut_connection_get_name (SalutPluginConnection *plugin_connection) return connection->name; } + +void +salut_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/connection.h b/src/connection.h index f843ba3a..d33e1921 100644 --- a/src/connection.h +++ b/src/connection.h @@ -109,6 +109,15 @@ WockySession * salut_connection_get_session (SalutPluginConnection *connection); const gchar * salut_connection_get_name (SalutPluginConnection *connection); +void salut_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 /* #ifndef __SALUT_CONNECTION_H__*/ diff --git a/src/protocol.c b/src/protocol.c index 453adf82..9dfcad58 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -286,6 +286,21 @@ get_interfaces_array (TpBaseProtocol *self) return interfaces; } +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) +{ + salut_connection_dup_avatar_requirements (supported_mime_types, min_height, + min_width, rec_height, rec_width, max_height, max_width, max_bytes); +} + static void salut_protocol_class_init (SalutProtocolClass *klass) { @@ -301,6 +316,7 @@ salut_protocol_class_init (SalutProtocolClass *klass) base_class->identify_account = identify_account; base_class->get_connection_details = get_connection_details; base_class->get_interfaces_array = get_interfaces_array; + base_class->get_avatar_details = get_avatar_details; object_class->get_property = salut_protocol_get_property; object_class->set_property = salut_protocol_set_property; -- cgit v1.2.1