diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-08-31 16:29:43 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-09-01 14:03:02 +0100 |
commit | 45dc8f926f18be249f24f66deb589907bda47f98 (patch) | |
tree | 446db943569ba205019bc3e0b72628730b6f1361 | |
parent | 7c6971a75a6eb32c77b64a7e9754e1fdb2a694af (diff) |
connection: send data forms in disco query replies
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | src/connection.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/connection.c b/src/connection.c index a941d6ec..e1404603 100644 --- a/src/connection.c +++ b/src/connection.c @@ -2598,6 +2598,7 @@ iq_disco_cb (WockyPorter *porter, const GabbleCapabilityInfo *info = NULL; const GabbleCapabilitySet *features = NULL; const GPtrArray *identities = NULL; + const GPtrArray *data_forms = NULL; /* query's existence is checked by WockyPorter before this function is called */ query = wocky_node_get_child (wocky_stanza_get_top_node (stanza), "query"); @@ -2627,19 +2628,25 @@ iq_disco_cb (WockyPorter *porter, wocky_node_set_attribute (result_query, "node", node); if (node == NULL) - features = gabble_presence_peek_caps (self->self_presence); + { + features = gabble_presence_peek_caps (self->self_presence); + data_forms = gabble_presence_peek_data_forms (self->self_presence); /* If node is not NULL, it can be either a caps bundle as defined in the * legacy XEP-0115 version 1.3 or an hash as defined in XEP-0115 version * 1.5. Let's see if it's a verification string we've told the cache about. */ + } else - info = gabble_presence_cache_peek_own_caps (self->presence_cache, - suffix); + { + info = gabble_presence_cache_peek_own_caps (self->presence_cache, + suffix); + } if (info) { features = info->cap_set; identities = info->identities; + data_forms = info->data_forms; } if (identities && identities->len != 0) @@ -2678,6 +2685,18 @@ iq_disco_cb (WockyPorter *porter, features = gabble_capabilities_get_bundle_video_v1 (); } + if (data_forms != NULL) + { + guint i; + + for (i = 0; i < data_forms->len; i++) + { + WockyDataForm *form = g_ptr_array_index (data_forms, i); + + wocky_data_form_add_to_node (form, result_query); + } + } + if (features == NULL && tp_strdiff (suffix, BUNDLE_PMUC_V1)) { _gabble_connection_send_iq_error (self, stanza, |