telepathy-salut: write-mgr-file: write Avatars properties

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Thu Sep 19 04:01:32 PDT 2013


Module: telepathy-salut
Branch: master
Commit: e7bf4518ba0c59cb347f9a1d324b2f699c9219ce
URL:    http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=e7bf4518ba0c59cb347f9a1d324b2f699c9219ce

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Sep 19 12:10:31 2013 +0200

write-mgr-file: write Avatars properties

Bare copy from Gabble.

https://bugs.freedesktop.org/show_bug.cgi?id=69508

---

 src/write-mgr-file.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/src/write-mgr-file.c b/src/write-mgr-file.c
index 7ef6e69..09b28b3 100644
--- a/src/write-mgr-file.c
+++ b/src/write-mgr-file.c
@@ -301,6 +301,7 @@ mgr_file_contents (const char *busname,
           TP_PROP_PROTOCOL_INTERFACES);
       const gchar * const *c_ifaces = tp_asv_get_strv (props,
           TP_PROP_PROTOCOL_CONNECTION_INTERFACES);
+      const gchar * const *mime_types;
 
       write_parameters (f, section_name, protocol);
       write_rccs (f, section_name, props);
@@ -314,6 +315,41 @@ mgr_file_contents (const char *busname,
       WRITE_STR (TP_PROP_PROTOCOL_ENGLISH_NAME, "EnglishName");
       WRITE_STR (TP_PROP_PROTOCOL_ICON, "Icon");
 
+      /* Avatars */
+      mime_types = tp_asv_get_strv (props,
+          TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES);
+
+      g_key_file_set_string_list (f, section_name, "SupportedAvatarMIMETypes",
+          mime_types, g_strv_length ((gchar **) mime_types));
+      g_key_file_set_integer (f, section_name, "MinimumAvatarHeight",
+          tp_asv_get_uint32 (props,
+              TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT,
+              NULL));
+      g_key_file_set_integer (f, section_name, "RecommendedAvatarHeight",
+          tp_asv_get_uint32 (props,
+              TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT,
+              NULL));
+      g_key_file_set_integer (f, section_name, "MaximumAvatarHeight",
+          tp_asv_get_uint32 (props,
+              TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT,
+              NULL));
+      g_key_file_set_integer (f, section_name, "MinimumAvatarWidth",
+          tp_asv_get_uint32 (props,
+              TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH,
+              NULL));
+      g_key_file_set_integer (f, section_name, "RecommendedAvatarWidth",
+          tp_asv_get_uint32 (props,
+              TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH,
+              NULL));
+      g_key_file_set_integer (f, section_name, "MaximumAvatarWidth",
+          tp_asv_get_uint32 (props,
+              TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH,
+              NULL));
+      g_key_file_set_integer (f, section_name, "MaximumAvatarBytes",
+          tp_asv_get_uint32 (props,
+              TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES,
+              NULL));
+
       g_free (section_name);
       g_hash_table_unref (props);
       protocols = protocols->next;



More information about the telepathy-commits mailing list