Implement namespace matching for immediate children. This makes the C library consistent with the JavaScript one.

This commit is contained in:
Jack Moffitt
2008-07-03 02:26:27 +00:00
parent 1c098531d8
commit 31843a423b

View File

@@ -36,7 +36,27 @@
static int _match_children(xmpp_stanza_t * const stanza,
const char * const ns)
{
return 0;
xmpp_stanza_t *child;
int matched = 0;
char *childns;
child = xmpp_stanza_get_children(stanza);
while (child) {
childns = xmpp_stanza_get_ns(child);
if (!childns) {
child = xmpp_stanza_get_next(child);
continue;
}
if (strcmp(ns, childns) == 0) {
matched = 1;
break;
}
child = xmpp_stanza_get_next(child);
}
return matched;
}
/** Fire off all stanza handlers that match.