From bc5265f6c9a571dc5126977e16a3a4e1eb298b41 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 18 Sep 2008 03:36:19 +0000 Subject: [PATCH] Bot shouldn't reply to message type="error", and also fixed comment. --- examples/bot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/bot.c b/examples/bot.c index 76c5064..4331820 100644 --- a/examples/bot.c +++ b/examples/bot.c @@ -1,4 +1,4 @@ -/* basic.c +/* bot.c ** libstrophe XMPP client library -- basic usage example ** ** Copyright (C) 2005 OGG, LCC. All rights reserved. @@ -74,6 +74,7 @@ int message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata; if(!xmpp_stanza_get_child_by_name(stanza, "body")) return 1; + if(!strcmp(xmpp_stanza_get_attribute(stanza, "type"), "error")) return 1; intext = xmpp_stanza_get_text(xmpp_stanza_get_child_by_name(stanza, "body"));