changeset 7926:68900f9cb540

[gaim-migrate @ 8597] tweak tweaky tweak committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 24 Dec 2003 01:48:25 +0000
parents 2014b91db201
children 1441648fe974
files po/POTFILES.in src/protocols/jabber/JEPS src/protocols/jabber/chat.c src/protocols/jabber/xdata.h
diffstat 4 files changed, 31 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/po/POTFILES.in	Tue Dec 23 23:41:51 2003 +0000
+++ b/po/POTFILES.in	Wed Dec 24 01:48:25 2003 +0000
@@ -76,6 +76,7 @@
 src/protocols/jabber/presence.c
 src/protocols/jabber/roster.c
 src/protocols/jabber/si.c
+src/protocols/jabber/xdata.c
 src/protocols/msn/dispatch.c
 src/protocols/msn/error.c
 src/protocols/msn/httpmethod.c
--- a/src/protocols/jabber/JEPS	Tue Dec 23 23:41:51 2003 +0000
+++ b/src/protocols/jabber/JEPS	Wed Dec 24 01:48:25 2003 +0000
@@ -1,5 +1,3 @@
-0004: NEED
-	Data Gathering and Reporting
 0045: IN PROGRESS
 	Multi-User Chat
 0047: IN PROGRESS
--- a/src/protocols/jabber/chat.c	Tue Dec 23 23:41:51 2003 +0000
+++ b/src/protocols/jabber/chat.c	Wed Dec 24 01:48:25 2003 +0000
@@ -290,6 +290,7 @@
 	xmlnode *query, *x;
 	const char *type = xmlnode_get_attrib(packet, "type");
 	const char *from = xmlnode_get_attrib(packet, "from");
+	char *msg;
 	JabberChat *chat;
 	JabberID *jid;
 
@@ -297,6 +298,7 @@
 		return;
 
 
+
 	if(!strcmp(type, "result")) {
 		jid = jabber_id_new(from);
 
@@ -325,10 +327,35 @@
 				return;
 			}
 		}
-	} else {
-		/* XXX: handle errors */
+	} else if(!strcmp(type, "error")) {
+		xmlnode *errnode = xmlnode_get_child(packet, "error");
+		const char *code = NULL;
+		char *code_txt = NULL;
+		char *msg;
+		char *text = NULL;
+
+		if(errnode) {
+			code = xmlnode_get_attrib(errnode, "code");
+			text = xmlnode_get_data(errnode);
+		}
+
+		if(code)
+			code_txt = g_strdup_printf(_(" (Code %s)"), code);
+
+		msg = g_strdup_printf("%s%s", text ? text : "", code_txt ? code_txt : "");
+		gaim_notify_error(js->gc, _("Configuration error"), _("Configuration error"), msg);
+
+		g_free(msg);
+		if(code_txt)
+			g_free(code_txt);
+
+		return;
 	}
 
+	msg = g_strdup_printf("Unable to configure room %s", from);
+
+	gaim_notify_info(js->gc, _("Unable to configure"), _("Unable to configure"), msg);
+	g_free(msg);
 
 }
 
--- a/src/protocols/jabber/xdata.h	Tue Dec 23 23:41:51 2003 +0000
+++ b/src/protocols/jabber/xdata.h	Wed Dec 24 01:48:25 2003 +0000
@@ -1,5 +1,5 @@
 /**
- * @file jutil.h utility functions
+ * @file xdata.h utility functions
  *
  * gaim
  *