diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/connection.c | 34 | ||||
-rw-r--r-- | src/connection.h | 9 | ||||
-rw-r--r-- | src/protocol.c | 16 |
3 files changed, 59 insertions, 0 deletions
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 @@ -287,6 +287,21 @@ get_interfaces_array (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) +{ + 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) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *) 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; |