changeset 32480:3967a194cb4e

This extra if-level can be dropped.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 28 Jan 2012 06:20:21 +0000
parents bc0d1855223f
children a23b6028539e
files libpurple/protocols/msn/oim.c
diffstat 1 files changed, 17 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/oim.c	Sat Jan 28 06:19:17 2012 +0000
+++ b/libpurple/protocols/msn/oim.c	Sat Jan 28 06:20:21 2012 +0000
@@ -676,29 +676,27 @@
 
 		g_free(decode_msg);
 
-	} else {
-		if (!g_utf8_validate(decode_msg, body_len, NULL)) {
-			char *clean = purple_utf8_salvage(decode_msg);
+	} else if (!g_utf8_validate(decode_msg, body_len, NULL)) {
+		char *clean = purple_utf8_salvage(decode_msg);
 
-			purple_debug_error("msn", "Received an OIM message that is not UTF-8,"
-			                          " and no encoding specified: %s\n", clean);
+		purple_debug_error("msn", "Received an OIM message that is not UTF-8,"
+		                          " and no encoding specified: %s\n", clean);
 
-			if (charset) {
-				clean_msg = g_strdup_printf(_("%s (There was an error receiving this message."
-				                              " The charset was %s, but it was not valid UTF-8.)"),
-				                            clean, charset);
-			} else {
-				clean_msg = g_strdup_printf(_("%s (There was an error receiving this message."
-				                              " The charset was missing, but it was not valid UTF-8.)"),
-				                            clean);
-			}
+		if (charset) {
+			clean_msg = g_strdup_printf(_("%s (There was an error receiving this message."
+			                              " The charset was %s, but it was not valid UTF-8.)"),
+			                            clean, charset);
+		} else {
+			clean_msg = g_strdup_printf(_("%s (There was an error receiving this message."
+			                              " The charset was missing, but it was not valid UTF-8.)"),
+			                            clean);
+		}
 
-			g_free(clean);
-			g_free(decode_msg);
+		g_free(clean);
+		g_free(decode_msg);
 
-		} else {
-			clean_msg = decode_msg;
-		}
+	} else {
+		clean_msg = decode_msg;
 	}
 
 	from = msn_message_get_header_value(message, "X-OIM-originatingSource");