Fix examples to use new API and lots of compiler warnings.

This commit is contained in:
Jack Moffitt
2008-07-02 23:17:27 +00:00
parent 65a174ee7e
commit 9c49b16554
22 changed files with 197 additions and 71 deletions

View File

@@ -32,6 +32,13 @@
#include "strophe.h"
#include "common.h"
/* do any of the immediate children have namespaces that match? */
static int _match_children(xmpp_stanza_t * const stanza,
const char * const ns)
{
return 0;
}
/** Fire off all stanza handlers that match.
* This function is called internally by the event loop whenever stanzas
* are received from the XMPP server.
@@ -99,7 +106,8 @@ void handler_fire_stanza(xmpp_conn_t * const conn,
continue;
}
if ((!item->ns || (ns && strcmp(ns, item->ns) == 0)) &&
if ((!item->ns || (ns && strcmp(ns, item->ns) == 0) ||
_match_children(stanza, item->ns)) &&
(!item->name || (name && strcmp(name, item->name) == 0)) &&
(!item->type || (type && strcmp(type, item->type) == 0)))
if (!((xmpp_handler)(item->handler))(conn, stanza, item->userdata)) {