# HG changeset patch # User Christian Hammond # Date 1080962271 0 # Node ID ee13d1befabe2fc4f1233e7b8ffa937276ffbfa5 # Parent 88988327a4e09fb37e9066c0bebd24004f508982 [gaim-migrate @ 9317] Patch by Stu Tomlinson to restore MSN error reporting. Thanks! committer: Tailor Script diff -r 88988327a4e0 -r ee13d1befabe ChangeLog --- 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: diff -r 88988327a4e0 -r ee13d1befabe src/protocols/msn/error.c --- 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); } diff -r 88988327a4e0 -r ee13d1befabe src/protocols/msn/notification.c --- 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; } diff -r 88988327a4e0 -r ee13d1befabe src/protocols/msn/servconn.c --- 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)