changeset 15678:5ec709327dc6

Remove a few unneeded strings, per evans's recommendation
author Sean Egan <seanegan@gmail.com>
date Thu, 22 Feb 2007 20:33:51 +0000
parents 43eff0c25647
children cad32dba756b
files libpurple/blist.c libpurple/protocols/msn/error.c libpurple/protocols/msn/error.h libpurple/protocols/oscar/oscar.c
diffstat 4 files changed, 37 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.c	Thu Feb 22 20:01:17 2007 +0000
+++ b/libpurple/blist.c	Thu Feb 22 20:33:51 2007 +0000
@@ -1910,28 +1910,8 @@
 	node = (GaimBlistNode *)group;
 
 	/* Make sure the group is empty */
-	if (node->child) {
-		char *buf;
-		int count = 0;
-		GaimBlistNode *child;
-
-		for (child = node->child; child != NULL; child = child->next)
-			count++;
-
-		buf = g_strdup_printf(ngettext("%d buddy from group %s was not removed "
-									   "because it belongs to an account which is "
-									   "disabled or offline.  This buddy and the "
-									   "group were not removed.\n",
-									   "%d buddies from group %s were not "
-									   "removed because they belong to accounts "
-									   "which are currently disabled or offline.  "
-									   "These buddies and the group were not "
-									   "removed.\n", count),
-							  count, group->name);
-		gaim_notify_error(NULL, NULL, _("Group not removed"), buf);
-		g_free(buf);
+	if (node->child)
 		return;
-	}
 
 	/* Remove the node from its parent */
 	if (gaimbuddylist->root == node)
--- a/libpurple/protocols/msn/error.c	Thu Feb 22 20:01:17 2007 +0000
+++ b/libpurple/protocols/msn/error.c	Thu Feb 22 20:33:51 2007 +0000
@@ -25,17 +25,21 @@
 #include "error.h"
 
 const char *
-msn_error_get_text(unsigned int type)
+msn_error_get_text(unsigned int type, gboolean *debug)
 {
 	static char msg[MSN_BUF_LEN];
+	debug = FALSE;
 
 	switch (type) {
 		case 0:
 			g_snprintf(msg, sizeof(msg),
 					   _("Unable to parse message"));
+			debug = TRUE;
+			break;
 		case 200:
 			g_snprintf(msg, sizeof(msg),
 					   _("Syntax Error (probably a client bug)"));
+			debug = TRUE;
 			break;
 		case 201:
 			g_snprintf(msg, sizeof(msg),
@@ -62,6 +66,7 @@
 			break;
 		case 215:
 			g_snprintf(msg, sizeof(msg), _("Already there"));
+			debug = TRUE;
 			break;
 		case 216:
 			g_snprintf(msg, sizeof(msg), _("Not on list"));
@@ -71,9 +76,11 @@
 			break;
 		case 218:
 			g_snprintf(msg, sizeof(msg), _("Already in the mode"));
+			debug = TRUE;
 			break;
 		case 219:
 			g_snprintf(msg, sizeof(msg), _("Already in opposite list"));
+			debug = TRUE;
 			break;
 		case 223:
 			g_snprintf(msg, sizeof(msg), _("Too many groups"));
@@ -89,6 +96,7 @@
 			break;
 		case 230:
 			g_snprintf(msg, sizeof(msg), _("Cannot remove group zero"));
+			debug = TRUE;
 			break;
 		case 231:
 			g_snprintf(msg, sizeof(msg),
@@ -97,16 +105,20 @@
 			break;
 		case 280:
 			g_snprintf(msg, sizeof(msg), _("Switchboard failed"));
+			debug = TRUE;
 			break;
 		case 281:
 			g_snprintf(msg, sizeof(msg), _("Notify transfer failed"));
+			debug = TRUE;
 			break;
 
 		case 300:
 			g_snprintf(msg, sizeof(msg), _("Required fields missing"));
+			debug = TRUE;
 			break;
 		case 301:
 			g_snprintf(msg, sizeof(msg), _("Too many hits to a FND"));
+			debug = TRUE;
 			break;
 		case 302:
 			g_snprintf(msg, sizeof(msg), _("Not logged in"));
@@ -117,18 +129,23 @@
 			break;
 		case 501:
 			g_snprintf(msg, sizeof(msg), _("Database server error"));
+			debug = TRUE;
 			break;
 		case 502:
 			g_snprintf(msg, sizeof(msg), _("Command disabled"));
+			debug = TRUE;
 			break;
 		case 510:
 			g_snprintf(msg, sizeof(msg), _("File operation error"));
+			debug = TRUE;
 			break;
 		case 520:
 			g_snprintf(msg, sizeof(msg), _("Memory allocation error"));
+			debug = TRUE;
 			break;
 		case 540:
 			g_snprintf(msg, sizeof(msg), _("Wrong CHL value sent to server"));
+			debug = TRUE;
 			break;
 
 		case 600:
@@ -139,9 +156,11 @@
 			break;
 		case 602:
 			g_snprintf(msg, sizeof(msg), _("Peer notification server down"));
+			debug = TRUE;
 			break;
 		case 603:
 			g_snprintf(msg, sizeof(msg), _("Database connect error"));
+			debug = TRUE;
 			break;
 		case 604:
 			g_snprintf(msg, sizeof(msg),
@@ -153,16 +172,19 @@
 
 		case 707:
 			g_snprintf(msg, sizeof(msg), _("Error creating connection"));
+			debug = TRUE;
 			break;
 		case 710:
 			g_snprintf(msg, sizeof(msg),
 					   _("CVR parameters are either unknown or not allowed"));
+			debug = TRUE;
 			break;
 		case 711:
 			g_snprintf(msg, sizeof(msg), _("Unable to write"));
 			break;
 		case 712:
 			g_snprintf(msg, sizeof(msg), _("Session overload"));
+			debug = TRUE;
 			break;
 		case 713:
 			g_snprintf(msg, sizeof(msg), _("User is too active"));
@@ -175,9 +197,11 @@
 			break;
 		case 717:
 			g_snprintf(msg, sizeof(msg), _("Bad friend file"));
+			debug = TRUE;
 			break;
 		case 731:
 			g_snprintf(msg, sizeof(msg), _("Not expected"));
+			debug = TRUE;
 			break;
 
 		case 800:
@@ -218,10 +242,12 @@
 			break;
 		case 928:
 			g_snprintf(msg, sizeof(msg), _("Bad ticket"));
+			debug = TRUE;
 			break;
 
 		default:
 			g_snprintf(msg, sizeof(msg), _("Unknown Error Code %d"), type);
+			debug = TRUE;
 			break;
 	}
 
@@ -232,9 +258,12 @@
 msn_error_handle(MsnSession *session, unsigned int type)
 {
 	char buf[MSN_BUF_LEN];
-
+	gboolean debug;
+	
 	g_snprintf(buf, sizeof(buf), _("MSN Error: %s\n"),
-			   msn_error_get_text(type));
-
-	gaim_notify_error(session->account->gc, NULL, buf, NULL);
+			   msn_error_get_text(type, &debug));
+	if (debug)
+		gaim_debug_warning("msn", "error %d: %s\n", type, buf);
+	else
+		gaim_notify_error(session->account->gc, NULL, buf, NULL);
 }
--- a/libpurple/protocols/msn/error.h	Thu Feb 22 20:01:17 2007 +0000
+++ b/libpurple/protocols/msn/error.h	Thu Feb 22 20:33:51 2007 +0000
@@ -30,10 +30,11 @@
  * Returns the string representation of an error type.
  *
  * @param type The error type.
+ * @param debug Whether this should be treated as a debug log message or a user-visible error
  *
  * @return The string representation of the error type.
  */
-const char *msn_error_get_text(unsigned int type);
+const char *msn_error_get_text(unsigned int type, gboolean *debug);
 
 /**
  * Handles an error.
--- a/libpurple/protocols/oscar/oscar.c	Thu Feb 22 20:01:17 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Thu Feb 22 20:33:51 2007 +0000
@@ -2713,7 +2713,6 @@
 static int gaim_parse_genericerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) {
 	va_list ap;
 	guint16 reason;
-	char *m;
 
 	va_start(ap, fr);
 	reason = (guint16) va_arg(ap, unsigned int);
@@ -2722,12 +2721,6 @@
 	gaim_debug_error("oscar",
 			   "snac threw error (reason 0x%04hx: %s)\n", reason,
 			   (reason < msgerrreasonlen) ? msgerrreason[reason] : "unknown");
-
-	m = g_strdup_printf(_("SNAC threw error: %s\n"),
-			reason < msgerrreasonlen ? _(msgerrreason[reason]) : _("Unknown error"));
-	gaim_notify_error(od->gc, NULL, m, NULL);
-	g_free(m);
-
 	return 1;
 }