pidgin: f12c9f6a: This extra if-level can be dropped.

qulogic at pidgin.im qulogic at pidgin.im
Fri Feb 3 01:56:45 EST 2012


----------------------------------------------------------------------
Revision: f12c9f6a6c31bcd3512f162209285a88a86595ff
Parent:   fdb56683f2b5f88f7b388aaef6c53c810d19e374
Author:   qulogic at pidgin.im
Date:     01/28/12 01:20:21
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f12c9f6a6c31bcd3512f162209285a88a86595ff

Changelog: 

This extra if-level can be dropped.

Changes against parent fdb56683f2b5f88f7b388aaef6c53c810d19e374

  patched  libpurple/protocols/msn/oim.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/oim.c	9d5bb783f66cb29d9b694d261db628f07ac1d713
+++ libpurple/protocols/msn/oim.c	94f3296d4bfed1844a27f425a86feba832760294
@@ -676,29 +676,27 @@ msn_oim_report_to_user(MsnOimRecvData *r
 
 		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");


More information about the Commits mailing list