summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-07-02 17:59:09 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-09-11 15:49:16 +0100
commit67d430ed9dbaf4244fcebaf828edba2698e1691d (patch)
tree464f79eac9287f48883b75a1eb488b6273433f63 /src/util.c
parent262c529cad07e8dd44a1b01ec3c0cff6d4e5b203 (diff)
util.c: properly re-implement lm_message_node_get_child_with_namespace using wocky API
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/src/util.c b/src/util.c
index 0d044b93b..7b8c59249 100644
--- a/src/util.c
+++ b/src/util.c
@@ -208,37 +208,20 @@ lm_message_node_get_child_with_namespace (LmMessageNode *node,
const gchar *name,
const gchar *ns)
{
+ LmMessageNode *found;
NodeIter i;
+ found = wocky_xmpp_node_get_child_ns (node, name, ns);
+ if (found != NULL)
+ return found;
+
for (i = node_iter (node); i; i = node_iter_next (i))
{
- LmMessageNode *tmp = node_iter_data (i);
- gchar *tag = NULL;
- gboolean found;
-
- if (tp_strdiff (tmp->name, name))
- {
- const gchar *suffix;
-
- suffix = strchr (tmp->name, ':');
-
- if (suffix == NULL)
- continue;
- else
- suffix++;
-
- if (tp_strdiff (suffix, name))
- continue;
-
- tag = g_strndup (tmp->name, suffix - tmp->name - 1);
- }
-
- found = lm_message_node_has_namespace (tmp, ns, tag);
-
- g_free (tag);
+ LmMessageNode *child = node_iter_data (i);
- if (found)
- return tmp;
+ found = lm_message_node_get_child_with_namespace (child, name, ns);
+ if (found != NULL)
+ return found;
}
return NULL;