changeset 30574:4f6273c899b9

jabber: Catch resource conflict IQ stanza errors returned by server Discussion on IETF XMPP WG mailing list pointed out this is a possible outcome, and needs to be handled better in clients. So, here's handling it better in clients!
author Paul Aurich <paul@darkrain42.org>
date Wed, 22 Sep 2010 06:05:14 +0000
parents 22a713532200
children 22749370f1cc
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Tue Sep 21 14:08:35 2010 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Wed Sep 22 06:05:14 2010 +0000
@@ -2641,13 +2641,19 @@
 	if(reason != NULL) { *reason = x; }
 
 	if((error = xmlnode_get_child(packet, "error"))) {
+		xmlnode *t = xmlnode_get_child_with_namespace(error, "text", NS_XMPP_STANZAS);
+		if (t)
+			cdata = xmlnode_get_data(t);
+#if 0
 		cdata = xmlnode_get_data(error);
+#endif
 		code = xmlnode_get_attrib(error, "code");
 
 		/* Stanza errors */
 		if(xmlnode_get_child(error, "bad-request")) {
 			text = _("Bad Request");
 		} else if(xmlnode_get_child(error, "conflict")) {
+			SET_REASON(PURPLE_CONNECTION_ERROR_NAME_IN_USE);
 			text = _("Conflict");
 		} else if(xmlnode_get_child(error, "feature-not-implemented")) {
 			text = _("Feature Not Implemented");