pidgin: 8e89c477: Support Yahoo !PingBox. Includes a coup...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Tue Feb 9 01:31:22 EST 2010


-----------------------------------------------------------------
Revision: 8e89c477b196af061a85afe2711dc8b3bccc78c4
Ancestor: 4b8d2fa4d4c4d564b9ca1894b476f084390a9223
Author: kartikmohta at gmail.com
Date: 2010-02-09T06:19:49
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8e89c477b196af061a85afe2711dc8b3bccc78c4

Modified files:
        libpurple/protocols/yahoo/libymsg.c
        libpurple/protocols/yahoo/libymsg.h
        libpurple/protocols/yahoo/util.c
        libpurple/protocols/yahoo/yahoo_friend.c

ChangeLog: 

Support Yahoo !PingBox.  Includes a couple warning fixes.  Fixes #7347.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	0cb34dda1f82d720a2771ad4fd0600456903b25c
+++ libpurple/protocols/yahoo/libymsg.c	334b02b1094c54f6778346615471096094b8d693
@@ -541,6 +541,9 @@ static void yahoo_process_list_15(Purple
 					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;
@@ -833,6 +836,9 @@ static void yahoo_process_notify(PurpleC
 			case YAHOO_FEDERATION_IBM:
 				fed_from = g_strconcat("ibm/", from, NULL);
 				break;
+			case YAHOO_FEDERATION_PBX:
+				fed_from = g_strconcat("pbx/", from, NULL);
+				break;
 			case YAHOO_FEDERATION_NONE:
 			default:
 				break;
@@ -844,7 +850,7 @@ static void yahoo_process_notify(PurpleC
 			serv_got_typing_stopped(gc, fed_from);
 		
 		if (fed_from != from)
-			g_free(fed_from);			
+			g_free(fed_from);
 	
 	} else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) {
 		PurpleBuddy *bud = purple_find_buddy(account, from);
@@ -999,6 +1005,9 @@ static void yahoo_process_message(Purple
 					case YAHOO_FEDERATION_IBM:
 						im->fed_from = g_strconcat("ibm/",im->from, NULL);
 						break;
+					case YAHOO_FEDERATION_PBX:
+						im->fed_from = g_strconcat("pbx/",im->from, NULL);
+						break;
 					case YAHOO_FEDERATION_NONE:
 					default:
 						im->fed_from = g_strdup(im->from);
@@ -1010,7 +1019,7 @@ static void yahoo_process_message(Purple
 			/* peer session id */
 			if (im && (pair->key == 11)) {
 				/* disconnect the peer if connected through p2p and sends wrong value for session id */
-				if( (im->fed == YAHOO_FEDERATION_NONE) && (pkt_type == YAHOO_PKT_TYPE_P2P) 
+				if( (im->fed == YAHOO_FEDERATION_NONE) && (pkt_type == YAHOO_PKT_TYPE_P2P)
 						&& (yd->session_id != strtol(pair->value, NULL, 10)) )
 				{
 					purple_debug_warning("yahoo","p2p: %s sent us message with wrong session id. Disconnecting p2p connection to peer\n", im->fed_from);
@@ -4428,6 +4437,7 @@ int yahoo_send_im(PurpleConnection *gc, 
 		case YAHOO_FEDERATION_MSN:
 		case YAHOO_FEDERATION_OCS:
 		case YAHOO_FEDERATION_IBM:
+		case YAHOO_FEDERATION_PBX:
 			fed_who += 4;
 			break;
 		case YAHOO_FEDERATION_NONE:
@@ -4528,6 +4538,7 @@ unsigned int yahoo_send_typing(PurpleCon
 			case YAHOO_FEDERATION_MSN:
 			case YAHOO_FEDERATION_OCS:
 			case YAHOO_FEDERATION_IBM:
+			case YAHOO_FEDERATION_PBX:
 				fed_who += 4;
 				break;
 			case YAHOO_FEDERATION_NONE:
============================================================
--- libpurple/protocols/yahoo/libymsg.h	b3521d7702ffbc8ae3676df4d65e28a07d61cb91
+++ libpurple/protocols/yahoo/libymsg.h	8e984834fb1d7ff646200227a9b586b97f4cea0e
@@ -138,7 +138,8 @@ typedef enum {
 	YAHOO_FEDERATION_NONE = 0, /* No federation - Yahoo! network */
 	YAHOO_FEDERATION_OCS = 1,  /* LCS or OCS private networks */
 	YAHOO_FEDERATION_MSN = 2,  /* MSN or Windows Live network */
-	YAHOO_FEDERATION_IBM = 9   /* IBM/Sametime network */
+	YAHOO_FEDERATION_IBM = 9,  /* IBM/Sametime network */
+	YAHOO_FEDERATION_PBX = 100 /* Yahoo! Pingbox service */
 } YahooFederation;
 
 
============================================================
--- libpurple/protocols/yahoo/util.c	6b3f181f8ec3546a8cb6a844b05f63bc80fb9304
+++ libpurple/protocols/yahoo/util.c	8b1a626fda1a7464e60bdbb4de4d48c6f4e695e5
@@ -932,6 +932,8 @@ YahooFederation yahoo_get_federation_fro
 			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;
 }
============================================================
--- libpurple/protocols/yahoo/yahoo_friend.c	e0861cd03a374f9feda5d3cd3b83a77d8aa8b77d
+++ libpurple/protocols/yahoo/yahoo_friend.c	d2845c0572ba943f7b7c9d9e82c9cd1138fe4748
@@ -186,6 +186,9 @@ void yahoo_process_presence(PurpleConnec
 		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;


More information about the Commits mailing list