From 1baaef858136cd3a4799b3ccf1d9961534e0017c Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 30 Jul 2007 20:12:06 +0100 Subject: Added jabber_error_parse() and using it for both stream- and stanza (only presence so far) errors. --- protocols/jabber/presence.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'protocols/jabber/presence.c') diff --git a/protocols/jabber/presence.c b/protocols/jabber/presence.c index e53978ea..cbfcedae 100644 --- a/protocols/jabber/presence.c +++ b/protocols/jabber/presence.c @@ -157,7 +157,17 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ) } else if( strcmp( type, "error" ) == 0 ) { - /* What to do with it? */ + struct jabber_error *err; + + if( ( c = xt_find_node( node->children, "error" ) ) ) + { + err = jabber_error_parse( c, XMLNS_STANZA_ERROR ); + imcb_error( ic, "Stanza (%s) error: %s%s%s", node->name, + err->code, err->text ? ": " : "", + err->text ? err->text : "" ); + jabber_error_free( err ); + } + /* What else to do with it? */ } else { -- cgit v1.2.3