/soc/2015/mmcc/main: bfe802e8be3e: fix some whitespace, simplify...

Michael McConville mmcconville at mykolab.com
Tue Jun 23 16:02:33 EDT 2015


Changeset: bfe802e8be3e65f5af9283aa743c90bdfceff105
Author:	 Michael McConville <mmcconville at mykolab.com>
Date:	 2015-06-18 13:16 -0400
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/mmcc/main/rev/bfe802e8be3e

Description:

fix some whitespace, simplify a local var assignment

diffstat:

 libpurple/protocols/yahoo/yahoo_aliases.c |  28 ++++++++++++++--------------
 libpurple/protocols/yahoo/yahoochat.c     |  14 +++++++-------
 libpurple/protocols/yahoo/ymsg.c          |  24 ++++++++++++------------
 3 files changed, 33 insertions(+), 33 deletions(-)

diffs (145 lines):

diff --git a/libpurple/protocols/yahoo/yahoo_aliases.c b/libpurple/protocols/yahoo/yahoo_aliases.c
--- a/libpurple/protocols/yahoo/yahoo_aliases.c
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c
@@ -128,7 +128,7 @@ yahoo_fetch_aliases_cb(PurpleHttpConnect
 				alias = NULL;
 
 				/* Yahoo stores first and last names separately, lets put them together into a full name */
-                full_name = g_strstrip(g_strdup_printf("%s %s", (fn != NULL ? fn : "") , (ln != NULL ? ln : "")));
+				full_name = g_strstrip(g_strdup_printf("%s %s", (fn != NULL ? fn : "") , (ln != NULL ? ln : "")));
 				nick_name = (nn != NULL ? g_strstrip(g_strdup(nn)) : NULL);
 
 				if (nick_name != NULL)
@@ -276,7 +276,7 @@ yahoo_update_alias(PurpleConnection *gc,
 	PurpleHttpRequest *req;
 	PurpleHttpCookieJar *cookiejar;
 	YahooData *yd;
-	gchar *content;
+	gchar *content, *escaped_alias;
 	struct callback_data *cb;
 	YahooFriend *f;
 
@@ -300,25 +300,25 @@ yahoo_update_alias(PurpleConnection *gc,
 	cb->id = g_strdup(yahoo_friend_get_alias_id(f));
 	cb->gc = gc;
 
+	escaped_alias = g_markup_escape_text(alias, -1);
+
 	if (cb->id == NULL) {
 		/* No id for this buddy, so create an address book entry */
 		purple_debug_info("yahoo", "Creating '%s' as new alias for user '%s'\n", alias, who);
 
-        gchar *escaped_alias = g_markup_escape_text(alias, -1);
-        content = g_strdup_printf("<?xml version=\"1.0\" encoding=\"utf-8\"?><ab k=\"%s\" cc=\"9\">\n"
-                      "<ct a=\"1\" yi='%s' nn='%s' />\n</ab>\r\n",
-                      purple_account_get_username(purple_connection_get_account(gc)),
-                      who, escaped_alias);
-        g_free(escaped_alias);
+		content = g_strdup_printf("<?xml version=\"1.0\" encoding=\"utf-8\"?><ab k=\"%s\" cc=\"9\">\n"
+				"<ct a=\"1\" yi='%s' nn='%s' />\n</ab>\r\n",
+				purple_account_get_username(purple_connection_get_account(gc)),
+				who, escaped_alias);
+		g_free(escaped_alias);
 	} else {
 		purple_debug_info("yahoo", "Updating '%s' as new alias for user '%s'\n", alias, who);
 
-        gchar *escaped_alias = g_markup_escape_text(alias, -1);
-        content = g_strdup_printf("<?xml version=\"1.0\" encoding=\"utf-8\"?><ab k=\"%s\" cc=\"1\">\n"
-                      "<ct e=\"1\"  yi='%s' id='%s' nn='%s' pr='0' />\n</ab>\r\n",
-                      purple_account_get_username(purple_connection_get_account(gc)),
-                      who, cb->id, escaped_alias);
-        g_free(escaped_alias);
+		content = g_strdup_printf("<?xml version=\"1.0\" encoding=\"utf-8\"?><ab k=\"%s\" cc=\"1\">\n"
+				"<ct e=\"1\"  yi='%s' id='%s' nn='%s' pr='0' />\n</ab>\r\n",
+				purple_account_get_username(purple_connection_get_account(gc)),
+				who, cb->id, escaped_alias);
+		g_free(escaped_alias);
 	}
 
 	req = purple_http_request_new(YAHOO_ALIAS_UPDATE_URL);
diff --git a/libpurple/protocols/yahoo/yahoochat.c b/libpurple/protocols/yahoo/yahoochat.c
--- a/libpurple/protocols/yahoo/yahoochat.c
+++ b/libpurple/protocols/yahoo/yahoochat.c
@@ -67,11 +67,11 @@ static void yahoo_chat_online(PurpleConn
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATONLINE, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "sssss",
-					  109, purple_connection_get_display_name(gc),
-					  1, purple_connection_get_display_name(gc),
-					  6, "abcde",
-					  98, rll,
-                      135, YAHOO_CLIENT_VERSION);
+			109, purple_connection_get_display_name(gc),
+			1, purple_connection_get_display_name(gc),
+			6, "abcde",
+			98, rll,
+			135, YAHOO_CLIENT_VERSION);
 	yahoo_packet_send_and_free(pkt, yd);
 }
 
@@ -1515,8 +1515,8 @@ PurpleRoomlist *yahoo_roomlist_get_list(
 
 	account = purple_connection_get_account(gc);
 
-    rll = purple_account_get_string(account, "room_list_locale", YAHOO_ROOMLIST_LOCALE);
-    rlurl = purple_account_get_string(account, "room_list", YAHOO_ROOMLIST_URL);
+	rll = purple_account_get_string(account, "room_list_locale", YAHOO_ROOMLIST_LOCALE);
+	rlurl = purple_account_get_string(account, "room_list", YAHOO_ROOMLIST_URL);
 
 	url = g_strdup_printf("%s?chatcat=0&intl=%s", rlurl, rll);
 
diff --git a/libpurple/protocols/yahoo/ymsg.c b/libpurple/protocols/yahoo/ymsg.c
--- a/libpurple/protocols/yahoo/ymsg.c
+++ b/libpurple/protocols/yahoo/ymsg.c
@@ -1720,7 +1720,7 @@ static char *yahoo_decode(const char *te
 
 	*n = '\0';
 
-    /* XXX: Is this related to Yahoo! Japan? If so, it should be removed. -mmcco */
+	/* XXX: Is this related to Yahoo! Japan? If so, it should be removed. -mmcco */
 	if (strstr(text, "\033$B"))
 		converted = g_convert(new, n - new, OUT_CHARSET, "iso-2022-jp", NULL, NULL, NULL);
 	if (!converted)
@@ -2496,7 +2496,7 @@ static void yahoo_p2p_write_pkt(gint sou
 	guchar *raw_packet;
 
 	/*build the raw packet and send it to the host*/
-    pkt_len = yahoo_packet_build(pkt, 0, 0, &raw_packet);
+	pkt_len = yahoo_packet_build(pkt, 0, 0, &raw_packet);
 	written = write(source, raw_packet, pkt_len);
 	if (written < 0 || (gsize)written != pkt_len)
 		purple_debug_warning("yahoo","p2p: couldn't write to the source\n");
@@ -3694,11 +3694,11 @@ static void yahoo_got_pager_server(Purpl
 		purple_debug_error("yahoo", "Unable to retrieve server info: %s\n",
 			purple_http_response_get_error(response));
 
-        if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
-                    yahoo_got_connected, gc) == NULL) {
-            purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-                    _("Unable to connect"));
-        }
+		if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
+				yahoo_got_connected, gc) == NULL) {
+			purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+					_("Unable to connect"));
+		}
 	} else {
 		got_data = purple_http_response_get_data(response, NULL);
 		strings = g_strsplit(got_data, "\r\n", -1);
@@ -3724,11 +3724,11 @@ static void yahoo_got_pager_server(Purpl
 			purple_debug_error("yahoo", "No CS address retrieved!  Server "
 					"response:\n%s\n", got_data);
 
-            if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
-                        yahoo_got_connected, gc) == NULL) {
-                purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-                        _("Unable to connect"));
-            }
+			if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
+					yahoo_got_connected, gc) == NULL) {
+				purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+						_("Unable to connect"));
+			}
 		}
 	}
 



More information about the Commits mailing list