diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-09-07 11:21:55 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-09-07 14:56:56 +0100 |
commit | ea717956461cd9966669b2d86f3015b99fd9702f (patch) | |
tree | 03a1fb7e0744777709de870f1c7946b2ce05f007 | |
parent | 0b24adad71ac6d5fe256f4cd852cadb2c129fd4d (diff) |
caps-manager: deal with the subtle differences in caps management
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | plugin-base/caps-manager.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin-base/caps-manager.c b/plugin-base/caps-manager.c index 2f90850..68cb973 100644 --- a/plugin-base/caps-manager.c +++ b/plugin-base/caps-manager.c @@ -168,6 +168,7 @@ make_new_data_form (const gchar *uid, return out; } +#ifdef SALUT static void add_to_array (gpointer key, gpointer value, @@ -175,6 +176,7 @@ add_to_array (gpointer key, { g_ptr_array_add (user_data, g_object_ref (value)); } +#endif static void ytst_caps_manager_represent_client (GabbleCapsChannelManager *manager, @@ -184,8 +186,10 @@ ytst_caps_manager_represent_client (GabbleCapsChannelManager *manager, GabbleCapabilitySet *cap_set, GPtrArray *data_forms) { +#ifdef SALUT YtstCapsManager *self = YTST_CAPS_MANAGER (manager); YtstCapsManagerPrivate *priv = self->priv; +#endif const gchar * const *t; const gchar *uid = NULL; @@ -250,18 +254,33 @@ ytst_caps_manager_represent_client (GabbleCapsChannelManager *manager, } } + /* So, gabble and salut have different ideas of how to save caps for + * clients. salut is arguably wrong here as it relies on the caps + * channel manager keeping a record of what clients can do. gabble + * does not need this and is simpler, so doesn't need the + * priv->services hash table at all. We should fix salut. */ + if (uid != NULL) { +#ifdef SALUT g_hash_table_insert (priv->services, g_strdup (client_name), make_new_data_form (uid, yts_type, names, caps)); +#else + g_ptr_array_add (data_forms, + make_new_data_form (uid, yts_type, names, caps)); +#endif } else { +#ifdef SALUT g_hash_table_remove (priv->services, client_name); +#endif } +#ifdef SALUT g_hash_table_foreach (priv->services, add_to_array, data_forms); +#endif g_ptr_array_unref (names); g_ptr_array_unref (caps); |