/pidgin/main: e666f49a3e86: Remove all Yahoo federation, none of...

Michael McConville mmcconville at mykolab.com
Tue Jul 21 22:38:41 EDT 2015


Changeset: e666f49a3e86a049fc5f6cbf2d37ce87acd7d0cb
Author:	 Michael McConville <mmcconville at mykolab.com>
Date:	 2015-07-21 22:38 -0400
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/e666f49a3e86

Description:

Remove all Yahoo federation, none of which is supported anymore. Ok'd by John Bailey (rekkanoryo). Refs #15907

diffstat:

 libpurple/protocols/yahoo/util.c           |   17 -
 libpurple/protocols/yahoo/yahoo_aliases.c  |    1 -
 libpurple/protocols/yahoo/yahoo_filexfer.c |    2 +-
 libpurple/protocols/yahoo/yahoo_filexfer.h |    2 -
 libpurple/protocols/yahoo/yahoo_friend.c   |   68 +---
 libpurple/protocols/yahoo/yahoo_friend.h   |    1 -
 libpurple/protocols/yahoo/ymsg.c           |  465 ++++------------------------
 libpurple/protocols/yahoo/ymsg.h           |   17 -
 8 files changed, 82 insertions(+), 491 deletions(-)

diffs (truncated from 1143 to 300 lines):

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
@@ -951,20 +951,3 @@ char *yahoo_html_to_codes(const char *sr
 
 	return g_string_free(dest, FALSE);
 }
-
-YahooFederation yahoo_get_federation_from_name(const char *who)
-{
-	YahooFederation fed = YAHOO_FEDERATION_NONE;
-	if (who[3] == '/') {
-		if (!g_ascii_strncasecmp(who, "msn", 3))
-			fed = YAHOO_FEDERATION_MSN;
-		else if (!g_ascii_strncasecmp(who, "ocs", 3))
-			fed = YAHOO_FEDERATION_OCS;
-		else if (!g_ascii_strncasecmp(who, "ibm", 3))
-			fed = YAHOO_FEDERATION_IBM;
-		else if (!g_ascii_strncasecmp(who, "pbx", 3))
-			fed = YAHOO_FEDERATION_PBX;
-	}
-	return fed;
-}
-
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
@@ -632,7 +632,6 @@ parse_contact_details(YahooData *yd, con
 	return TRUE;
 }
 
-/* I don't think this happens for MSN buddies. -- sad */
 void yahoo_process_contact_details(PurpleConnection *gc, struct yahoo_packet *pkt)
 {
 	GSList *l = pkt->hash;
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
@@ -578,7 +578,7 @@ static void yahoo_xfer_dns_connected_15(
 
 gboolean yahoo_can_receive_file(PurpleConnection *gc, const char *who)
 {
-	if (!who || yahoo_get_federation_from_name(who) != YAHOO_FEDERATION_NONE)
+	if (!who)
 		return FALSE;
 	return TRUE;
 }
diff --git a/libpurple/protocols/yahoo/yahoo_filexfer.h b/libpurple/protocols/yahoo/yahoo_filexfer.h
--- a/libpurple/protocols/yahoo/yahoo_filexfer.h
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.h
@@ -39,8 +39,6 @@ PurpleXfer *yahoo_new_xfer(PurpleConnect
 
 /**
  * Returns TRUE if the buddy can receive file, FALSE otherwise.
- * Federated users cannot receive files. So this will return FALSE only
- * for them.
  *
  * @param gc The connection
  * @param who The name of the remote user
diff --git a/libpurple/protocols/yahoo/yahoo_friend.c b/libpurple/protocols/yahoo/yahoo_friend.c
--- a/libpurple/protocols/yahoo/yahoo_friend.c
+++ b/libpurple/protocols/yahoo/yahoo_friend.c
@@ -153,7 +153,6 @@ void yahoo_process_presence(PurpleConnec
 	char *temp = NULL;
 	char *who = NULL;
 	int value = 0;
-	YahooFederation fed = YAHOO_FEDERATION_NONE;
 
 	while (l) {
 		struct yahoo_pair *pair = l->data;
@@ -170,9 +169,6 @@ void yahoo_process_presence(PurpleConnec
 			case 31:
 				value = strtol(pair->value, NULL, 10);
 				break;
-			case 241:
-				fed = strtol(pair->value, NULL, 10);
-				break;
 		}
 
 		l = l->next;
@@ -183,23 +179,8 @@ void yahoo_process_presence(PurpleConnec
 		return;
 	}
 
-	switch (fed) {
-		case YAHOO_FEDERATION_MSN:
-			who = g_strconcat("msn/", temp, NULL);
-			break;
-		case YAHOO_FEDERATION_OCS:
-			who = g_strconcat("ocs/", temp, NULL);
-			break;
-		case YAHOO_FEDERATION_IBM:
-			who = g_strconcat("ibm/", temp, NULL);
-			break;
-		case YAHOO_FEDERATION_PBX:
-			who = g_strconcat("pbx/", temp, NULL);
-			break;
-		case YAHOO_FEDERATION_NONE:
-			who = g_strdup(temp);
-			break;
-	}
+	who = g_strdup(temp);
+
 	g_return_if_fail(who != NULL);
 
 	f = yahoo_friend_find(gc, who);
@@ -246,10 +227,7 @@ void yahoo_friend_update_presence(Purple
 	if (!f)
 		return;
 
-	if(f->fed != YAHOO_FEDERATION_NONE)
-		temp = name+4;
-	else
-		temp = name;
+	temp = name;
 
 	/* No need to change the value if it is already correct */
 	if (f->presence == presence) {
@@ -275,20 +253,12 @@ void yahoo_friend_update_presence(Purple
 		if (f->presence == YAHOO_PRESENCE_PERM_OFFLINE) {
 			pkt = yahoo_packet_new(YAHOO_SERVICE_PRESENCE_PERM,
 					YAHOO_STATUS_AVAILABLE, yd->session_id);
-			if(f->fed)
-				yahoo_packet_hash(pkt, "ssssssiss",
-					1, purple_connection_get_display_name(gc),
-					31, "2", 13, "2",
-					302, "319", 300, "319",
-					7, temp, 241, f->fed,
-					301, "319", 303, "319");
-			else
-				yahoo_packet_hash(pkt, "ssssssss",
-					1, purple_connection_get_display_name(gc),
-					31, "2", 13, "2",
-					302, "319", 300, "319",
-					7, temp,
-					301, "319", 303, "319");
+			yahoo_packet_hash(pkt, "ssssssss",
+				1, purple_connection_get_display_name(gc),
+				31, "2", 13, "2",
+				302, "319", 300, "319",
+				7, temp,
+				301, "319", 303, "319");
 
 			yahoo_packet_send_and_free(pkt, yd);
 		}
@@ -302,20 +272,12 @@ void yahoo_friend_update_presence(Purple
 		pkt = yahoo_packet_new(service,
 				YAHOO_STATUS_AVAILABLE, yd->session_id);
 
-		if(f->fed)
-			yahoo_packet_hash(pkt, "ssssssiss",
-				1, purple_connection_get_display_name(gc),
-				31, thirtyone, 13, thirteen,
-				302, "319", 300, "319",
-				7, temp, 241, f->fed,
-				301, "319", 303, "319");
-		else
-			yahoo_packet_hash(pkt, "ssssssss",
-				1, purple_connection_get_display_name(gc),
-				31, thirtyone, 13, thirteen,
-				302, "319", 300, "319",
-				7, temp,
-				301, "319", 303, "319");
+		yahoo_packet_hash(pkt, "ssssssss",
+			1, purple_connection_get_display_name(gc),
+			31, thirtyone, 13, thirteen,
+			302, "319", 300, "319",
+			7, temp,
+			301, "319", 303, "319");
 
 		yahoo_packet_send_and_free(pkt, yd);
 	}
diff --git a/libpurple/protocols/yahoo/yahoo_friend.h b/libpurple/protocols/yahoo/yahoo_friend.h
--- a/libpurple/protocols/yahoo/yahoo_friend.h
+++ b/libpurple/protocols/yahoo/yahoo_friend.h
@@ -55,7 +55,6 @@ typedef struct _YahooFriend {
 	gchar *ip;
 	gboolean bicon_sent_request;
 	YahooPresenceVisibility presence;
-	YahooFederation fed;
 	long int version_id;
 	YahooPersonalDetails ypd;
 	YahooP2PStatus p2p_status;
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
@@ -159,8 +159,6 @@ static void yahoo_process_status(PurpleC
 	char *name = NULL;
 	gboolean unicode = FALSE;
 	char *message = NULL;
-	YahooFederation fed = YAHOO_FEDERATION_NONE;
-	char *fedname = NULL;
 
 	if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) {
 		if (!purple_account_get_remember_password(account))
@@ -190,38 +188,8 @@ static void yahoo_process_status(PurpleC
 			name = message = NULL;
 			f = NULL;
 			if (pair->value && g_utf8_validate(pair->value, -1, NULL)) {
-				GSList *tmplist;
-
 				name = pair->value;
-
-				/* Look ahead to see if we have the federation info about the buddy */
-				for (tmplist = l->next; tmplist; tmplist = tmplist->next) {
-					struct yahoo_pair *p = tmplist->data;
-					if (p->key == 7)
-						break;
-					if (p->key == 241) {
-						fed = strtol(p->value, NULL, 10);
-						g_free(fedname);
-						switch (fed) {
-							case YAHOO_FEDERATION_MSN:
-								name = fedname = g_strconcat("msn/", name, NULL);
-								break;
-							case YAHOO_FEDERATION_OCS:
-								name = fedname = g_strconcat("ocs/", name, NULL);
-								break;
-							case YAHOO_FEDERATION_IBM:
-								name = fedname = g_strconcat("ibm/", name, NULL);
-								break;
-							case YAHOO_FEDERATION_NONE:
-							default:
-								fedname = NULL;
-								break;
-						}
-						break;
-					}
-				}
 				f = yahoo_friend_find_or_new(gc, name);
-				f->fed = fed;
 			}
 			break;
 		case 10: /* state */
@@ -379,8 +347,6 @@ static void yahoo_process_status(PurpleC
 			if(f && strtol(pair->value, NULL, 10))
 				f->version_id = strtol(pair->value, NULL, 10);
 			break;
-		case 241: /* Federated network buddy belongs to */
-			break;  /* We process this when get '7' */
 		default:
 			purple_debug_warning("yahoo",
 					   "Unknown status key %d\n", pair->key);
@@ -399,8 +365,6 @@ static void yahoo_process_status(PurpleC
 		if (name) /* update the last buddy */
 			yahoo_update_status(gc, name, f);
 	}
-
-	g_free(fedname);
 }
 
 static void yahoo_do_group_check(PurpleAccount *account, GHashTable *ht, const char *name, const char *group)
@@ -507,7 +471,6 @@ static void yahoo_process_list_15(Purple
 	char *temp = NULL;
 	YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */
 	                       /* But what if you had no friends? */
-	YahooFederation fed = YAHOO_FEDERATION_NONE;
 	int stealth = 0;
 
 	ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_slist_free);
@@ -532,23 +495,8 @@ static void yahoo_process_list_15(Purple
 			break;
 		case 301: /* This is 319 before all s/n's in a group after the first. It is followed by an identical 300. */
 			if(temp != NULL) {
-				switch (fed) {
-					case YAHOO_FEDERATION_MSN:
-						norm_bud = g_strconcat("msn/", temp, NULL);
-						break;
-					case YAHOO_FEDERATION_OCS:
-						norm_bud = g_strconcat("ocs/", temp, NULL);
-						break;
-					case YAHOO_FEDERATION_IBM:
-						norm_bud = g_strconcat("ibm/", temp, NULL);
-						break;
-					case YAHOO_FEDERATION_PBX:
-						norm_bud = g_strconcat("pbx/", temp, NULL);
-						break;
-					case YAHOO_FEDERATION_NONE:
-						norm_bud = g_strdup(temp);
-						break;
-				}
+				norm_bud = g_strdup(temp);
+
 				if (yd->current_list15_grp) {
 					/* This buddy is in a group */
 					f = yahoo_friend_find_or_new(gc, norm_bud);
@@ -563,19 +511,12 @@ static void yahoo_process_list_15(Purple
 						purple_blist_add_buddy(b, NULL, g, NULL);
 					}
 					yahoo_do_group_check(account, ht, norm_bud, yd->current_list15_grp);
-					if(fed) {
-						f->fed = fed;
-						purple_debug_info("yahoo", "Setting federation to %d\n", f->fed);
-					}
+
 					if(stealth == 2)
 						f->presence = YAHOO_PRESENCE_PERM_OFFLINE;
 
-					/* set p2p status not connected and no p2p packet sent */
-					if(fed == YAHOO_FEDERATION_NONE) {



More information about the Commits mailing list