pidgin: 0f7ebf12: Change a bunch more of our yahoo packets...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sat Jul 18 12:15:21 EDT 2009


-----------------------------------------------------------------
Revision: 0f7ebf12821809ef6debe2b50834f1fc0ba97f09
Ancestor: ea17b906d0f9b7422adfebcbec58d7c06d3bd8bc
Author: rekkanoryo at pidgin.im
Date: 2009-07-18T16:12:12
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0f7ebf12821809ef6debe2b50834f1fc0ba97f09

Modified files:
        libpurple/protocols/yahoo/yahoo_doodle.c
        libpurple/protocols/yahoo/yahoo_picture.c
        libpurple/protocols/yahoo/yahoochat.c

ChangeLog: 

Change a bunch more of our yahoo packets to use the session ID.  I believe this
is now all of the packets that aren't p2p related (those packets get their ID's
differently).  I also changed what version of the client we claim to be for the
chatrooms.  We were claiming to be "ym8.1.0.415" when we should have claimed to
be whatever version is defined in YAHOO_CLIENT_VERSION.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo_doodle.c	1ed8166f6ab52332db8fe3a2cb06d02b8fa1f8ff
+++ libpurple/protocols/yahoo/yahoo_doodle.c	6939d4e6fac2d15c443e22fc4b37e20a960a54e1
@@ -392,7 +392,7 @@ static void yahoo_doodle_command_send_ge
 	yd = gc->proto_data;
 
 	/* Make and send an acknowledge (ready) Doodle packet */
-	pkt = yahoo_packet_new(YAHOO_SERVICE_P2PFILEXFER, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_P2PFILEXFER, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash_str(pkt, 49,  "IMVIRONMENT");
 	yahoo_packet_hash_str(pkt, 1,    purple_account_get_username(gc->account));
 	yahoo_packet_hash_str(pkt, 14,   message);
============================================================
--- libpurple/protocols/yahoo/yahoo_picture.c	4edc0fb63a3a5e3461e078e63135888c8b17dabe
+++ libpurple/protocols/yahoo/yahoo_picture.c	662606e6040315f7478b610b3b08f77f67a9f1ce
@@ -276,7 +276,7 @@ void yahoo_send_picture_info(PurpleConne
 		return;
 	}
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "ssssi", 1, purple_connection_get_display_name(gc),
 	                  5, who,
 	                  13, "2", 20, yd->picture_url, 192, yd->picture_checksum);
@@ -288,7 +288,7 @@ void yahoo_send_picture_request(PurpleCo
 	struct yahoo_data *yd = gc->proto_data;
 	struct yahoo_packet *pkt;
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash_str(pkt, 1, purple_connection_get_display_name(gc)); /* me */
 	yahoo_packet_hash_str(pkt, 5, who); /* the other guy */
 	yahoo_packet_hash_str(pkt, 13, "1"); /* 1 = request, 2 = reply */
@@ -300,7 +300,7 @@ void yahoo_send_picture_checksum(PurpleC
 	struct yahoo_data *yd = gc->proto_data;
 	struct yahoo_packet *pkt;
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE_CHECKSUM, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE_CHECKSUM, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "ssi", 1, purple_connection_get_display_name(gc),
 			  212, "1", 192, yd->picture_checksum);
 	yahoo_packet_send_and_free(pkt, yd);
@@ -311,7 +311,7 @@ void yahoo_send_picture_update_to_user(P
 	struct yahoo_data *yd = gc->proto_data;
 	struct yahoo_packet *pkt;
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_AVATAR_UPDATE, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_AVATAR_UPDATE, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "si", 3, who, 213, type);
 	yahoo_packet_send_and_free(pkt, yd);
 }
============================================================
--- libpurple/protocols/yahoo/yahoochat.c	7944be00c40d8e436445c330efa2fa78d34834ec
+++ libpurple/protocols/yahoo/yahoochat.c	806e80d67fcd4c9b9d5b2404ff91924827f2dea1
@@ -65,14 +65,14 @@ static void yahoo_chat_online(PurpleConn
 	rll = purple_account_get_string(purple_connection_get_account(gc),
 								  "room_list_locale", YAHOO_ROOMLIST_LOCALE);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATONLINE, YAHOO_STATUS_AVAILABLE,0);
+	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",
 					/* I'm not sure this is the correct way to set this. */
 					  98, rll,
-					  135, "ym8.1.0.415");
+					  135, YAHOO_CLIENT_VERSION);
 	yahoo_packet_send_and_free(pkt, yd);
 }
 
@@ -376,7 +376,7 @@ static void yahoo_chat_join(PurpleConnec
 	 * so we don't have to actually pass the flag in the packet. Or something. */
 	room2 = yahoo_string_encode(gc, room, &utf8);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATJOIN, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATJOIN, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "ssss",
 						1, purple_connection_get_display_name(gc),
 						104, room2,
@@ -396,7 +396,7 @@ void yahoo_process_chat_online(PurpleCon
 
 		/* We need to goto a user in chat */
 		if (yd->pending_chat_goto) {
-			struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_CHATGOTO, YAHOO_STATUS_AVAILABLE, 0);
+			struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_CHATGOTO, YAHOO_STATUS_AVAILABLE, yd->session_id);
 			yahoo_packet_hash(pkt, "sss",
 				109, yd->pending_chat_goto,
 				1, purple_connection_get_display_name(gc),
@@ -764,7 +764,7 @@ void yahoo_conf_leave(struct yahoo_data 
 
 	purple_debug_misc("yahoo", "leaving conference %s\n", room);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGOFF, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGOFF, YAHOO_STATUS_AVAILABLE, yd->session_id);
 
 	yahoo_packet_hash_str(pkt, 1, dn);
 	for (w = who; w; w = w->next) {
@@ -788,7 +788,7 @@ static int yahoo_conf_send(PurpleConnect
 	msg = yahoo_html_to_codes(what);
 	msg2 = yahoo_string_encode(gc, msg, &utf8);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFMSG, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFMSG, YAHOO_STATUS_AVAILABLE, yd->session_id);
 
 	yahoo_packet_hash_str(pkt, 1, dn);
 	for (who = members; who; who = who->next) {
@@ -816,7 +816,7 @@ static void yahoo_conf_join(struct yahoo
 	if (members)
 		memarr = g_strsplit(members, "\n", 0);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGON, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGON, YAHOO_STATUS_AVAILABLE, yd->session_id);
 
 	yahoo_packet_hash(pkt, "sss", 1, dn, 3, dn, 57, room);
 	if (memarr) {
@@ -846,7 +846,7 @@ static void yahoo_conf_invite(PurpleConn
 
 	members = purple_conv_chat_get_users(PURPLE_CONV_CHAT(c));
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFADDINVITE, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFADDINVITE, YAHOO_STATUS_AVAILABLE, yd->session_id);
 
 	yahoo_packet_hash(pkt, "sssss", 1, dn, 51, buddy, 57, room, 58, msg?msg2:"", 13, "0");
 	for(; members; members = members->next) {
@@ -882,7 +882,7 @@ static void yahoo_chat_leave(PurpleConne
 
 	eroom = yahoo_string_encode(gc, room, &utf8);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATEXIT, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATEXIT, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "sss", 104, eroom, 109, dn, 108, "1");
 	yahoo_packet_hash_str(pkt, 112, "0"); /* what does this one mean? */
 	yahoo_packet_send_and_free(pkt, yd);
@@ -900,7 +900,7 @@ static void yahoo_chat_leave(PurpleConne
 		return;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATLOGOUT,
-			YAHOO_STATUS_AVAILABLE, 0);
+			YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash_str(pkt, 1, dn);
 	yahoo_packet_send_and_free(pkt, yd);
 
@@ -941,7 +941,7 @@ static int yahoo_chat_send(PurpleConnect
 	g_free(msg2);
 	room2 = yahoo_string_encode(gc, room, NULL);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_COMMENT, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_COMMENT, YAHOO_STATUS_AVAILABLE, yd->session_id);
 
 	yahoo_packet_hash(pkt, "sss", 1, dn, 104, room2, 117, msg1);
 	if (me)
@@ -978,7 +978,7 @@ static void yahoo_chat_invite(PurpleConn
 	if (msg)
 		msg2 = yahoo_string_encode(gc, msg, NULL);
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATADDINVITE, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATADDINVITE, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "sssss", 1, dn, 118, buddy, 104, room2, 117, (msg2?msg2:""), 129, "0");
 	yahoo_packet_send_and_free(pkt, yd);
 
@@ -1012,7 +1012,7 @@ void yahoo_chat_goto(PurpleConnection *g
 		return;
 	}
 
-	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATGOTO, YAHOO_STATUS_AVAILABLE, 0);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATGOTO, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt, "sss", 109, name, 1, purple_connection_get_display_name(gc), 62, "2");
 	yahoo_packet_send_and_free(pkt, yd);
 }


More information about the Commits mailing list