changeset 8569:ee13d1befabe

[gaim-migrate @ 9317] Patch by Stu Tomlinson to restore MSN error reporting. Thanks! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 03 Apr 2004 03:17:51 +0000
parents 88988327a4e0
children 1a62ab7225f3
files ChangeLog src/protocols/msn/error.c src/protocols/msn/notification.c src/protocols/msn/servconn.c
diffstat 4 files changed, 22 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Apr 03 01:33:45 2004 +0000
+++ b/ChangeLog	Sat Apr 03 03:17:51 2004 +0000
@@ -1,8 +1,10 @@
 Gaim: The Pimpin' Penguin IM Client that's good for the soul!
 
 version 0.77cvs
+	Bug Fixes:
 	* Save Conversation works again (Kevin Stange)
 	* The Clear button in privacy works (Robert Mibus)
+	* MSN error reporting works again (Stu Tomlinson)
 
 version 0.76 (04/01/2004):
 	New Features:
--- a/src/protocols/msn/error.c	Sat Apr 03 01:33:45 2004 +0000
+++ b/src/protocols/msn/error.c	Sat Apr 03 03:17:51 2004 +0000
@@ -28,16 +28,19 @@
 	static char msg[MSN_BUF_LEN];
 
 	switch (type) {
+		case 0:
+			g_snprintf(msg, sizeof(msg),
+					   _("Unable to parse message"));
 		case 200:
 			g_snprintf(msg, sizeof(msg),
 					   _("Syntax Error (probably a Gaim bug)"));
 			break;
 		case 201:
 			g_snprintf(msg, sizeof(msg),
-					   _("Invalid Parameter (probably a Gaim bug)"));
+					   _("Invalid email address"));
 			break;
 		case 205:
-			g_snprintf(msg, sizeof(msg), _("Invalid User"));
+			g_snprintf(msg, sizeof(msg), _("User does not exist"));
 			break;
 		case 206:
 			g_snprintf(msg, sizeof(msg),
@@ -166,7 +169,7 @@
 			g_snprintf(msg, sizeof(msg), _("Too many sessions"));
 			break;
 		case 715:
-			g_snprintf(msg, sizeof(msg), _("Not expected"));
+			g_snprintf(msg, sizeof(msg), _("Passport not verified"));
 			break;
 		case 717:
 			g_snprintf(msg, sizeof(msg), _("Bad friend file"));
@@ -226,9 +229,10 @@
 void
 msn_error_handle(MsnSession *session, unsigned int type)
 {
-	const char *text;
+	char buf[MSN_BUF_LEN];
 
-	text = msn_error_get_text(type);
+	g_snprintf(buf, sizeof(buf), _("MSN Error: %s\n"),
+					msn_error_get_text(type));
 
-	gaim_notify_error(session->account->gc, NULL, text, NULL);
+	gaim_notify_error(session->account->gc, NULL, buf, NULL);
 }
--- a/src/protocols/msn/notification.c	Sat Apr 03 01:33:45 2004 +0000
+++ b/src/protocols/msn/notification.c	Sat Apr 03 03:17:51 2004 +0000
@@ -198,10 +198,10 @@
 unknown_cmd(MsnServConn *servconn, const char *command, const char **params,
 			size_t param_count)
 {
-	char buf[MSN_BUF_LEN];
-
+	int errnum = 0;
+	
 	if (isdigit(*command)) {
-		int errnum = atoi(command);
+		errnum = atoi(command);
 
 		if (errnum == 225) {
 			/*
@@ -211,15 +211,9 @@
 			 */
 			return TRUE;
 		}
-
-		g_snprintf(buf, sizeof(buf), _("MSN Error: %s\n"),
-				   msn_error_get_text(errnum));
 	}
-	else {
-		g_snprintf(buf, sizeof(buf), "MSN Error: Unable to parse message\n");
-	}
-
-	gaim_notify_error(servconn->session->account->gc, NULL, buf, NULL);
+	
+	msn_error_handle(servconn->session, errnum);
 
 	return TRUE;
 }
--- a/src/protocols/msn/servconn.c	Sat Apr 03 01:33:45 2004 +0000
+++ b/src/protocols/msn/servconn.c	Sat Apr 03 03:17:51 2004 +0000
@@ -21,6 +21,7 @@
  */
 #include "msn.h"
 #include "servconn.h"
+#include "error.h"
 
 typedef struct
 {
@@ -84,7 +85,10 @@
 		cb = g_hash_table_lookup(servconn->commands, "_unknown_");
 
 		if (cb == NULL) {
-			gaim_debug(GAIM_DEBUG_WARNING, "msn",
+			if (isdigit(*str))
+				msn_error_handle(session, atoi(str));
+			else
+				gaim_debug(GAIM_DEBUG_WARNING, "msn",
 					   "Unhandled command '%s'\n", str);
 
 			if (params != NULL)