/soc/2015/mmcc/main: 0cf05a71fef7: Remove Yahoo! Japan

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


Changeset: 0cf05a71fef79afa1d2910235e0b3a25d900c46a
Author:	 Michael McConville <mmcconville at mykolab.com>
Date:	 2015-06-18 01:42 -0400
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/mmcc/main/rev/0cf05a71fef7

Description:

Remove Yahoo! Japan

diffstat:

 libpurple/accounts.c                              |  35 --------
 libpurple/protocols/yahoo/Makefile.am             |   2 -
 libpurple/protocols/yahoo/Makefile.mingw          |   1 -
 libpurple/protocols/yahoo/util.c                  |  10 +--
 libpurple/protocols/yahoo/yahoo.c                 |  12 ---
 libpurple/protocols/yahoo/yahoo_aliases.c         |  62 ++++-----------
 libpurple/protocols/yahoo/yahoo_filexfer.c        |  15 +---
 libpurple/protocols/yahoo/yahoo_packet.c          |   7 +-
 libpurple/protocols/yahoo/yahoo_packet.h          |   4 +-
 libpurple/protocols/yahoo/yahoo_picture.c         |   5 +-
 libpurple/protocols/yahoo/yahoo_profile.c         |  42 +++------
 libpurple/protocols/yahoo/yahoochat.c             |  14 +--
 libpurple/protocols/yahoo/ymsg.c                  |  72 +++++------------
 libpurple/protocols/yahoo/ymsg.h                  |  25 +-----
 pidgin/pixmaps/emotes/default/24/default.theme.in |  92 -----------------------
 pidgin/pixmaps/emotes/small/16/small.theme.in     |  36 ---------
 po/POTFILES.in                                    |   1 -
 po/br.po                                          |  35 --------
 po/brx.po                                         |  35 --------
 po/es_AR.po                                       |  35 --------
 po/hy.po                                          |  35 --------
 po/kk.po                                          |  35 --------
 po/ks.po                                          |  35 --------
 po/lv.po                                          |  35 --------
 po/ms_MY.po                                       |  35 --------
 po/pl.po                                          |  34 --------
 po/sd.po                                          |  35 --------
 po/tt.po                                          |  35 --------
 po/uz.po                                          |  35 --------
 29 files changed, 69 insertions(+), 785 deletions(-)

diffs (truncated from 2277 to 300 lines):

diff --git a/libpurple/accounts.c b/libpurple/accounts.c
--- a/libpurple/accounts.c
+++ b/libpurple/accounts.c
@@ -89,38 +89,6 @@ purple_accounts_schedule_save(void)
 		save_timer = purple_timeout_add_seconds(5, save_cb, NULL);
 }
 
-/*********************************************************************
- * Reading from disk                                                 *
- *********************************************************************/
-static void
-migrate_yahoo_japan(PurpleAccount *account)
-{
-	/* detect a Yahoo! JAPAN account that existed prior to 2.6.0 and convert it
-	 * to use the new yahoojp protocol.  Also remove the account-specific settings
-	 * we no longer need */
-
-	if(purple_strequal(purple_account_get_protocol_id(account), "prpl-yahoo")) {
-		if(purple_account_get_bool(account, "yahoojp", FALSE)) {
-			const char *serverjp = purple_account_get_string(account, "serverjp", NULL);
-			const char *xferjp_host = purple_account_get_string(account, "xferjp_host", NULL);
-
-			g_return_if_fail(serverjp != NULL);
-			g_return_if_fail(xferjp_host != NULL);
-
-			purple_account_set_string(account, "server", serverjp);
-			purple_account_set_string(account, "xfer_host", xferjp_host);
-
-			purple_account_set_protocol_id(account, "prpl-yahoojp");
-		}
-
-		/* these should always be nuked */
-		purple_account_remove_setting(account, "yahoojp");
-		purple_account_remove_setting(account, "serverjp");
-		purple_account_remove_setting(account, "xferjp_host");
-
-	}
-}
-
 static void
 migrate_icq_server(PurpleAccount *account)
 {
@@ -226,9 +194,6 @@ parse_settings(PurpleXmlNode *node, Purp
 	}
 
 	/* we do this here because we need access to account settings to determine
-	 * if we can/should migrate an old Yahoo! JAPAN account */
-	migrate_yahoo_japan(account);
-	/* we do this here because we need access to account settings to determine
 	 * if we can/should migrate an ICQ account's server setting */
 	migrate_icq_server(account);
 	/* we do this here because we need to do it before the user views the
diff --git a/libpurple/protocols/yahoo/Makefile.am b/libpurple/protocols/yahoo/Makefile.am
--- a/libpurple/protocols/yahoo/Makefile.am
+++ b/libpurple/protocols/yahoo/Makefile.am
@@ -9,8 +9,6 @@ YAHOOSOURCES = \
 	yahoochat.c \
 	yahoo.c \
 	yahoo.h \
-	yahoojp.c \
-	yahoojp.h \
 	yahoo_aliases.c \
 	yahoo_aliases.h \
 	yahoo_doodle.h \
diff --git a/libpurple/protocols/yahoo/Makefile.mingw b/libpurple/protocols/yahoo/Makefile.mingw
--- a/libpurple/protocols/yahoo/Makefile.mingw
+++ b/libpurple/protocols/yahoo/Makefile.mingw
@@ -40,7 +40,6 @@ LIB_PATHS +=		-L. \
 ##
 C_SRC =			util.c \
 			yahoo.c \
-			yahoojp.c \
 			yahoochat.c \
 			yahoo_aliases.c \
 			yahoo_doodle.c \
diff --git a/libpurple/protocols/yahoo/util.c b/libpurple/protocols/yahoo/util.c
--- a/libpurple/protocols/yahoo/util.c
+++ b/libpurple/protocols/yahoo/util.c
@@ -121,14 +121,10 @@ gchar* yahoo_get_cookies(PurpleConnectio
 
 char *yahoo_string_encode(PurpleConnection *gc, const char *str, gboolean utf8)
 {
-	YahooData *yd = purple_connection_get_protocol_data(gc);
 	char *ret;
 	const char *to_codeset;
 	GError *error = NULL;
 
-	if (yd->jp)
-		return g_strdup(str);
-
 	if (utf8) /* FIXME: maybe don't use utf8 if it'll fit in latin1 */
 		return g_strdup(str);
 
@@ -161,7 +157,6 @@ char *yahoo_string_encode(PurpleConnecti
  */
 char *yahoo_string_decode(PurpleConnection *gc, const char *str, gboolean utf8)
 {
-	YahooData *yd = purple_connection_get_protocol_data(gc);
 	char *ret;
 	const char *from_codeset;
 	GError *error = NULL;
@@ -173,10 +168,7 @@ char *yahoo_string_decode(PurpleConnecti
 				"to be UTF-8, but it was not. Will try another encoding.\n");
 	}
 
-	if (yd->jp)
-		from_codeset = "SHIFT_JIS";
-	else
-		from_codeset = purple_account_get_string(purple_connection_get_account(gc), "local_charset",  "ISO-8859-1");
+    from_codeset = purple_account_get_string(purple_connection_get_account(gc), "local_charset",  "ISO-8859-1");
 
 	ret = g_convert_with_fallback(str, -1, "UTF-8", from_codeset, NULL, NULL, NULL, &error);
 	if (!ret) {
diff --git a/libpurple/protocols/yahoo/yahoo.c b/libpurple/protocols/yahoo/yahoo.c
--- a/libpurple/protocols/yahoo/yahoo.c
+++ b/libpurple/protocols/yahoo/yahoo.c
@@ -29,7 +29,6 @@
 
 #include "ymsg.h"
 #include "yahoo.h"
-#include "yahoojp.h"
 #include "yahoochat.h"
 #include "yahoo_aliases.h"
 #include "yahoo_doodle.h"
@@ -37,7 +36,6 @@
 #include "yahoo_picture.h"
 
 static PurpleProtocol *yahoo_protocol = NULL;
-static PurpleProtocol *yahoojp_protocol = NULL;
 
 static GSList *cmds = NULL;
 
@@ -386,20 +384,14 @@ static gboolean
 plugin_load(PurplePlugin *plugin, GError **error)
 {
 	yahoo_protocol_register_type(plugin);
-	yahoojp_protocol_register_type(plugin);
 
 	yahoo_protocol = purple_protocols_add(YAHOO_TYPE_PROTOCOL, error);
 	if (!yahoo_protocol)
 		return FALSE;
 
-	yahoojp_protocol = purple_protocols_add(YAHOOJP_TYPE_PROTOCOL, error);
-	if (!yahoojp_protocol)
-		return FALSE;
-
 	yahoo_init_colorht();
 
 	yahoo_register_commands();
-	yahoojp_register_commands();
 
 	purple_signal_connect(purple_get_core(), "uri-handler", yahoo_protocol,
 		PURPLE_CALLBACK(yahoo_uri_handler), NULL);
@@ -410,14 +402,10 @@ plugin_load(PurplePlugin *plugin, GError
 static gboolean
 plugin_unload(PurplePlugin *plugin, GError **error)
 {
-	yahoojp_unregister_commands();
 	yahoo_unregister_commands();
 
 	yahoo_dest_colorht();
 
-	if (!purple_protocols_remove(yahoojp_protocol, error))
-		return FALSE;
-
 	if (!purple_protocols_remove(yahoo_protocol, error))
 		return FALSE;
 
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
@@ -40,8 +40,6 @@
 /* I hate hardcoding this stuff, but Yahoo never sends us anything to use.  Someone in the know may be able to tweak this URL */
 #define YAHOO_ALIAS_FETCH_URL "http://address.yahoo.com/yab/us?v=XM&prog=ymsgr&.intl=us&diffs=1&t=0&tags=short&rt=0&prog-ver=" YAHOO_CLIENT_VERSION "&useutf8=1&legenc=codepage-1252"
 #define YAHOO_ALIAS_UPDATE_URL "http://address.yahoo.com/yab/us?v=XM&prog=ymsgr&.intl=us&sync=1&tags=short&noclear=1&useutf8=1&legenc=codepage-1252"
-#define YAHOOJP_ALIAS_FETCH_URL "http://address.yahoo.co.jp/yab/jp?v=XM&prog=ymsgr&.intl=jp&diffs=1&t=0&tags=short&rt=0&prog-ver=" YAHOOJP_CLIENT_VERSION
-#define YAHOOJP_ALIAS_UPDATE_URL "http://address.yahoo.co.jp/yab/jp?v=XM&prog=ymsgr&.intl=jp&sync=1&tags=short&noclear=1"
 
 void yahoo_update_alias(PurpleConnection *gc, const char *who, const char *alias);
 
@@ -130,10 +128,7 @@ yahoo_fetch_aliases_cb(PurpleHttpConnect
 				alias = NULL;
 
 				/* Yahoo stores first and last names separately, lets put them together into a full name */
-				if (yd->jp)
-					full_name = g_strstrip(g_strdup_printf("%s %s", (ln != NULL ? ln : "") , (fn != NULL ? fn : "")));
-				else
-					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)
@@ -199,8 +194,7 @@ yahoo_fetch_aliases(PurpleConnection *gc
 	PurpleHttpRequest *req;
 	PurpleHttpCookieJar *cookiejar;
 
-	req = purple_http_request_new(yd->jp ? YAHOOJP_ALIAS_FETCH_URL :
-		YAHOO_ALIAS_FETCH_URL);
+	req = purple_http_request_new(YAHOO_ALIAS_FETCH_URL);
 	/* XXX: see the other note about user-agent */
 	purple_http_request_header_set(req, "User-Agent",
 		"Mozilla/4.0 (compatible; MSIE 5.5)");
@@ -310,47 +304,24 @@ yahoo_update_alias(PurpleConnection *gc,
 		/* 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);
 
-		if (yd->jp) {
-			gchar *alias_jp = g_convert(alias, -1, "EUC-JP", "UTF-8", NULL, NULL, NULL);
-			gchar *converted_alias_jp = yahoo_convert_to_numeric(alias_jp);
-			content = g_strdup_printf("<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, converted_alias_jp);
-			g_free(converted_alias_jp);
-			g_free(alias_jp);
-		} else {
-			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);
-		}
+        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);
 	} else {
 		purple_debug_info("yahoo", "Updating '%s' as new alias for user '%s'\n", alias, who);
 
-		if (yd->jp) {
-			gchar *alias_jp = g_convert(alias, -1, "EUC-JP", "UTF-8", NULL, NULL, NULL);
-			gchar *converted_alias_jp = yahoo_convert_to_numeric(alias_jp);
-			content = g_strdup_printf("<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, converted_alias_jp);
-			g_free(converted_alias_jp);
-			g_free(alias_jp);
-		} else {
-			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);
-		}
+        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);
 	}
 
-	req = purple_http_request_new(yd->jp ? YAHOOJP_ALIAS_UPDATE_URL:
-		YAHOO_ALIAS_UPDATE_URL);
+	req = purple_http_request_new(YAHOO_ALIAS_UPDATE_URL);
 	purple_http_request_set_method(req, "POST");
 	/* XXX: We get rs="ERROR:-100:No Login", when we set
 	 * YAHOO_CLIENT_USERAGENT (Mozilla/5.0) here.
@@ -478,8 +449,7 @@ yahoo_set_userinfo_cb(PurpleConnection *
 	}
 #endif
 
-	req = purple_http_request_new(yd->jp ? YAHOOJP_USERINFO_URL :
-		YAHOO_USERINFO_URL);
+	req = purple_http_request_new(YAHOO_USERINFO_URL);
 	purple_http_request_set_method(req, "POST");
 	/* XXX: see the previous comment for user-agent */
 	purple_http_request_header_set(req, "User-Agent",
diff --git a/libpurple/protocols/yahoo/yahoo_filexfer.c b/libpurple/protocols/yahoo/yahoo_filexfer.c
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c
@@ -727,18 +727,9 @@ void yahoo_process_filetrans_15(PurpleCo
 		xd->is_relay = TRUE;
 
 		account = purple_connection_get_account(gc);
-		if (yd->jp)
-		{
-			purple_dnsquery_a(account, YAHOOJP_XFER_RELAY_HOST,
-							YAHOOJP_XFER_RELAY_PORT,
-							yahoo_xfer_dns_connected_15, xfer);
-		}
-		else
-		{
-			purple_dnsquery_a(account, YAHOO_XFER_RELAY_HOST,
-							YAHOO_XFER_RELAY_PORT,
-							yahoo_xfer_dns_connected_15, xfer);
-		}
+        purple_dnsquery_a(account, YAHOO_XFER_RELAY_HOST,
+                        YAHOO_XFER_RELAY_PORT,
+                        yahoo_xfer_dns_connected_15, xfer);
 		return;
 	}
 
diff --git a/libpurple/protocols/yahoo/yahoo_packet.c b/libpurple/protocols/yahoo/yahoo_packet.c
--- a/libpurple/protocols/yahoo/yahoo_packet.c



More information about the Commits mailing list