soc.2008.yahoo: 6948f2bd: minor changes in comments style and alph...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Sat Jul 12 15:50:58 EDT 2008


-----------------------------------------------------------------
Revision: 6948f2bd4761c17e21efe7e3d7577f529ebe8491
Ancestor: b5a864a00f441e73c0fa8babad81136a96013fd5
Author: sulabh at soc.pidgin.im
Date: 2008-07-12T19:44:24
Branch: im.pidgin.soc.2008.yahoo
URL: http://d.pidgin.im/viewmtn/revision/info/6948f2bd4761c17e21efe7e3d7577f529ebe8491

Modified files:
        libpurple/protocols/yahoo/yahoo.c
        libpurple/protocols/yahoo/yahoo.h
        libpurple/protocols/yahoo/yahoo_filexfer.c
        libpurple/protocols/yahoo/yahoo_friend.h
        libpurple/protocols/yahoo/yahoo_packet.h

ChangeLog: 

minor changes in comments style and alphabetic ordering of header files.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	dcb12d8df4616efdad7b2582d4944c44e27c1404
+++ libpurple/protocols/yahoo/yahoo.c	c273fc5b59224eb56ebc3709074beb51d7579384
@@ -30,6 +30,7 @@
 #include "cmds.h"
 #include "core.h"
 #include "debug.h"
+#include "network.h"
 #include "notify.h"
 #include "privacy.h"
 #include "prpl.h"
@@ -38,7 +39,6 @@
 #include "server.h"
 #include "util.h"
 #include "version.h"
-#include "network.h"
 
 #include "yahoo.h"
 #include "yahoochat.h"
@@ -216,7 +216,7 @@ static void yahoo_process_status(PurpleC
 			if (f->status == YAHOO_STATUS_IDLE) {
 				/* Idle may have already been set in a more precise way in case 137 */
 				if (f->idle == 0)
-					f->idle = time(NULL) - 60;	/*Start idle at 1 min*/
+					f->idle = time(NULL) - 60;	/* Start idle at 1 min */
 			} else
 				f->idle = 0;
 
@@ -249,7 +249,7 @@ static void yahoo_process_status(PurpleC
 			if (f->away == 2) {
 				/* Idle may have already been set in a more precise way in case 137 */
 				if (f->idle == 0)
-					f->idle = time(NULL) - 60;	/*start idle at 1 min*/
+					f->idle = time(NULL) - 60;	/* start idle at 1 min */
 			}
 
 			break;
@@ -519,7 +519,7 @@ static void yahoo_process_list_15(Purple
 				}
 				yahoo_do_group_check(account, ht, norm_bud, yd->current_list15_grp);
 				
-				/*set p2p status not connected and no p2p packet sent*/
+				/* set p2p status not connected and no p2p packet sent */
 				yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_NOT_CONNECTED);
 				f->p2p_packet_sent = 0;
 
@@ -636,7 +636,7 @@ static void yahoo_process_list(PurpleCon
 				}
 
 				yahoo_do_group_check(account, ht, norm_bud, grp);
-				/*set p2p status not connected and no p2p packet sent*/
+				/* set p2p status not connected and no p2p packet sent */
 				yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_NOT_CONNECTED);
 				f->p2p_packet_sent = 0;
 
@@ -696,7 +696,7 @@ static void yahoo_process_list(PurpleCon
 	yahoo_fetch_aliases(gc);
 }
 
-/*pkt_type is YAHOO_PKT_TYPE_SERVER if pkt arrives from yahoo server, YAHOO_PKT_TYPE_P2P if pkt arrives through p2p*/
+/* pkt_type is YAHOO_PKT_TYPE_SERVER if pkt arrives from yahoo server, YAHOO_PKT_TYPE_P2P if pkt arrives through p2p */
 static void yahoo_process_notify(PurpleConnection *gc, struct yahoo_packet *pkt, yahoo_pkt_type pkt_type)
 {
 	PurpleAccount *account;
@@ -729,10 +729,10 @@ static void yahoo_process_notify(PurpleC
 	if (!from || !msg)
 		return;
 
-	/*disconnect the peer if connected through p2p and sends wrong value for session id*/
+	/* disconnect the peer if connected through p2p and sends wrong value for session id */
 	if( (pkt_type == YAHOO_PKT_TYPE_P2P) && (val_11 != yd->session_id) ) {
 		purple_debug_warning("yahoo","p2p: %s sent us notify with wrong session id. Disconnecting p2p connection to peer\n", from);
-		/*remove from p2p connection lists, also calls yahoo_p2p_disconnect_destroy_data*/
+		/* remove from p2p connection lists, also calls yahoo_p2p_disconnect_destroy_data */
 		g_hash_table_remove(yd->peers, from);
 		return;
 	}
@@ -781,7 +781,7 @@ struct _yahoo_im {
 	char *msg;
 };
 
-/*pkt_type is YAHOO_PKT_TYPE_SERVER if pkt arrives from yahoo server, YAHOO_PKT_TYPE_P2P if pkt arrives through p2p*/
+/* pkt_type is YAHOO_PKT_TYPE_SERVER if pkt arrives from yahoo server, YAHOO_PKT_TYPE_P2P if pkt arrives through p2p */
 static void yahoo_process_message(PurpleConnection *gc, struct yahoo_packet *pkt, yahoo_pkt_type pkt_type)
 {
 	PurpleAccount *account;
@@ -818,7 +818,7 @@ static void yahoo_process_message(Purple
 				if (im)
 					im->msg = pair->value;
 			}
-			/*peer session id*/
+			/* peer session id */
 			if (pair->key == 11) {
 				if (im)
 					val_11 = strtol(pair->value, NULL, 10);
@@ -835,10 +835,10 @@ static void yahoo_process_message(Purple
 		                  _("Your Yahoo! message did not get sent."), NULL);
 	}
 
-	/*disconnect the peer if connected through p2p and sends wrong value for session id*/
+	/* disconnect the peer if connected through p2p and sends wrong value for session id */
 	if( (pkt_type == YAHOO_PKT_TYPE_P2P) && (val_11 != yd->session_id) ) {
 		purple_debug_warning("yahoo","p2p: %s sent us message with wrong session id. Disconnecting p2p connection to peer\n", im->from);
-		/*remove from p2p connection lists, also calls yahoo_p2p_disconnect_destroy_data*/
+		/* remove from p2p connection lists, also calls yahoo_p2p_disconnect_destroy_data */
 		g_hash_table_remove(yd->peers, im->from);
 		return;
 	}
@@ -2244,11 +2244,11 @@ static void yahoo_process_addbuddy(Purpl
 		yahoo_update_status(gc, who, f);
 		
 		if( !g_hash_table_lookup(yd->peers, who) )	{
-			/*we are not connected as client, so set friend to not connected*/
+			/* we are not connected as client, so set friend to not connected */
 			yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_NOT_CONNECTED);
 			f->p2p_packet_sent = 0;
 		}
-		else	/*we are already connected. set friend to YAHOO_P2PSTATUS_WE_ARE_CLIENT*/
+		else	/* we are already connected. set friend to YAHOO_P2PSTATUS_WE_ARE_CLIENT */
 			yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_WE_ARE_CLIENT);
 		return;
 	}
@@ -2262,9 +2262,9 @@ static void yahoo_process_addbuddy(Purpl
 	g_free(decoded_group);
 }
 
-/*destroy p2p_data associated with a peer and close p2p connection.
- *g_hash_table_remove() calls this function to destroy p2p_data associated with the peer,
- *call g_hash_table_remove() instead of this fucntion if peer has an entry in the table */
+/* destroy p2p_data associated with a peer and close p2p connection.
+ * g_hash_table_remove() calls this function to destroy p2p_data associated with the peer,
+ * call g_hash_table_remove() instead of this fucntion if peer has an entry in the table */
 static void yahoo_p2p_disconnect_destroy_data(gpointer data)
 {
 	struct yahoo_p2p_data *p2p_data;
@@ -2273,7 +2273,7 @@ static void yahoo_p2p_disconnect_destroy
 	if(!(p2p_data = data))
 		return ;
 
-	/*If friend, set him not connected*/
+	/* If friend, set him not connected */
 	f = yahoo_friend_find(p2p_data->gc, p2p_data->host_username);
 	if (f)
 		yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_NOT_CONNECTED);
@@ -2286,7 +2286,7 @@ static void yahoo_p2p_disconnect_destroy
 	g_free(p2p_data);
 }
 
-/*write pkt to the source*/
+/* write pkt to the source */
 static void yahoo_p2p_write_pkt(gint source, struct yahoo_packet *pkt)
 {
 	size_t pkt_len;
@@ -2299,7 +2299,7 @@ static void yahoo_p2p_write_pkt(gint sou
 	g_free(raw_packet);
 }
 
-/*exchange of initial p2pfilexfer packets, service type YAHOO_SERVICE_P2PFILEXFER*/
+/* exchange of initial p2pfilexfer packets, service type YAHOO_SERVICE_P2PFILEXFER */
 static void yahoo_p2p_process_p2pfilexfer(gpointer data, gint source, struct yahoo_packet *pkt)
 {
 	struct yahoo_p2p_data *p2p_data;
@@ -2329,20 +2329,20 @@ static void yahoo_p2p_process_p2pfilexfe
 			}
 			break;
 		case 13:
-			p2p_data->val_13 = strtol(pair->value, NULL, 10);	/*Value should be 5-7*/
+			p2p_data->val_13 = strtol(pair->value, NULL, 10);	/* Value should be 5-7 */
 			break;
-		/*case 5, 49 look laters, no use right now*/
+		/* case 5, 49 look laters, no use right now */
 		}
 		l = l->next;
 	}
 
 	account = purple_connection_get_account(p2p_data->gc);
 
-	/*key_13: sort of a counter.
-	 *WHEN WE ARE CLIENT: yahoo server sends val_13 = 0, we send to peer val_13 = 1, receive back val_13 = 5,
-	 *we send val_13=6, receive val_13=7, we send val_13=7, HALT. Keep sending val_13 = 7 as keep alive.
-	 *WHEN WE ARE SERVER: we send val_13 = 0 to yahoo server, peer sends us val_13 = 1, we send val_13 = 5,
-	 *receive val_13 = 6, send val_13 = 7, receive val_13 = 7. HALT. Keep sending val_13 = 7 as keep alive.*/
+	/* key_13: sort of a counter.
+	 * WHEN WE ARE CLIENT: yahoo server sends val_13 = 0, we send to peer val_13 = 1, receive back val_13 = 5,
+	 * we send val_13=6, receive val_13=7, we send val_13=7, HALT. Keep sending val_13 = 7 as keep alive.
+	 * WHEN WE ARE SERVER: we send val_13 = 0 to yahoo server, peer sends us val_13 = 1, we send val_13 = 5,
+	 * receive val_13 = 6, send val_13 = 7, receive val_13 = 7. HALT. Keep sending val_13 = 7 as keep alive. */
 
 	switch(p2p_data->val_13)	{
 		case 1 : val_13_to_send = 5; break;
@@ -2353,24 +2353,24 @@ static void yahoo_p2p_process_p2pfilexfe
 			 return;
 		}
 
-	/*Build the yahoo packet*/
+	/* Build the yahoo packet */
 	pkt_to_send = yahoo_packet_new(YAHOO_SERVICE_P2PFILEXFER, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt_to_send, "ssisi",
 		4, purple_normalize(account, purple_account_get_username(account)),
 		5, p2p_data->host_username,
-		241, 0,		/*Protocol identifier*/
+		241, 0,		/* Protocol identifier */
 		49, "PEERTOPEER",
 		13, val_13_to_send);
 
-	/*build the raw packet and send it to the host*/
+	/* build the raw packet and send it to the host */
 	yahoo_p2p_write_pkt(source, pkt_to_send);
 	yahoo_packet_free(pkt_to_send);
 }
 
-/*callback function associated with receiving of data, not considering receipt of multiple YMSG packets in a single TCP packet*/
+/* callback function associated with receiving of data, not considering receipt of multiple YMSG packets in a single TCP packet */
 static void yahoo_p2p_read_pkt_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	guchar buf[1024];	/*is it safe to assume a fixed array length of 1024 ??*/
+	guchar buf[1024];	/* is it safe to assume a fixed array length of 1024 ?? */
 	int len;
 	int pos = 0;
 	int pktlen;
@@ -2389,7 +2389,7 @@ static void yahoo_p2p_read_pkt_cb(gpoint
 	else if (len <= 0)
 	{
 		purple_debug_warning("yahoo","p2p: Error in connection, or host disconnected\n");
-		/*remove from p2p connection lists, also calls yahoo_p2p_disconnect_destroy_data*/
+		/* remove from p2p connection lists, also calls yahoo_p2p_disconnect_destroy_data */
 		g_hash_table_remove(yd->peers,p2p_data->host_username);
 		return;
 	}
@@ -2426,7 +2426,7 @@ static void yahoo_p2p_read_pkt_cb(gpoint
 	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "p2p: Yahoo Service: 0x%02x Status: %d\n",pkt->service, pkt->status);
 	yahoo_packet_read(pkt, buf + pos, pktlen);
 
-	/*packet processing*/
+	/* packet processing */
 	switch(pkt->service)	{
 		case YAHOO_SERVICE_P2PFILEXFER:
 			yahoo_p2p_process_p2pfilexfer(data, source, pkt);
@@ -2464,7 +2464,7 @@ static void yahoo_p2p_server_send_connec
 		return;
 	}
 
-	/*remove watcher and close p2p server*/
+	/* remove watcher and close p2p server */
 	purple_input_remove(yd->yahoo_p2p_server_watcher);
 	close(yd->yahoo_local_p2p_server_fd);
 	yd->yahoo_local_p2p_server_fd = -1;
@@ -2474,7 +2474,7 @@ static void yahoo_p2p_server_send_connec
 		yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_WE_ARE_SERVER);
 	}
 
-	/*Add an Input Read event to the file descriptor*/
+	/* Add an Input Read event to the file descriptor */
 	p2p_data->input_event = purple_input_add(acceptfd, PURPLE_INPUT_READ, yahoo_p2p_read_pkt_cb, data);
 	p2p_data->source = acceptfd;
 
@@ -2497,12 +2497,12 @@ static void yahoo_p2p_server_listen_cb(i
 
 	yd = p2p_data->gc->proto_data;
 
-	/*Add an Input Read event to the file descriptor*/
+	/* Add an Input Read event to the file descriptor */
 	yd->yahoo_local_p2p_server_fd = listenfd;
 	yd->yahoo_p2p_server_watcher = purple_input_add(listenfd, PURPLE_INPUT_READ, yahoo_p2p_server_send_connected_cb,data);
 }
 
-/*send p2p pkt containing our encoded ip, asking peer to connect to us*/
+/* send p2p pkt containing our encoded ip, asking peer to connect to us */
 static void yahoo_send_p2p_pkt(PurpleConnection *gc, const char *who, int val_13)
 {
 	const char *public_ip;
@@ -2527,7 +2527,7 @@ static void yahoo_send_p2p_pkt(PurpleCon
 	f = yahoo_friend_find(gc, who);
 	account = purple_connection_get_account(gc);
 
-	/*send packet to only those friends who arent p2p connected and to whom we havent already sent. Do not send if this condition doesn't hold good*/ 
+	/* send packet to only those friends who arent p2p connected and to whom we havent already sent. Do not send if this condition doesn't hold good */ 
 	if( !( f && (yahoo_friend_get_p2p_status(f) == YAHOO_P2PSTATUS_NOT_CONNECTED) && (f->p2p_packet_sent == 0)) )
 		return;
 
@@ -2535,15 +2535,15 @@ static void yahoo_send_p2p_pkt(PurpleCon
 	yahoo_packet_hash(pkt, "sssissis",
 		1, purple_normalize(account, purple_account_get_username(account)),
 		4, purple_normalize(account, purple_account_get_username(account)),
-		12, base64_ip,	/*base64 encode ip*/
-		61, 0,		/*To-do : figure out what is 61 for??*/
+		12, base64_ip,	/* base64 encode ip */
+		61, 0,		/* To-do : figure out what is 61 for?? */
 		2, "",
 		5, who,
 		13, val_13,
 		49, "PEERTOPEER");
 	yahoo_packet_send_and_free(pkt, yd);
 
-	f->p2p_packet_sent = 1;	/*set p2p_packet_sent to sent*/
+	f->p2p_packet_sent = 1;	/* set p2p_packet_sent to sent */
 
 	p2p_data->gc = gc;
 	p2p_data->host_ip = NULL;
@@ -2557,7 +2557,7 @@ static void yahoo_send_p2p_pkt(PurpleCon
 	g_free(base64_ip);
 }
 
-/*function called when connection to p2p host is setup*/
+/* function called when connection to p2p host is setup */
 static void yahoo_p2p_init_cb(gpointer data, gint source, const gchar *error_message)
 {
 	struct yahoo_p2p_data *p2p_data;
@@ -2572,35 +2572,35 @@ static void yahoo_p2p_init_cb(gpointer d
 
 	if(error_message != NULL)	{
 		purple_debug_warning("yahoo","p2p: %s\n",error_message);
-		yahoo_send_p2p_pkt(p2p_data->gc, p2p_data->host_username, 2);/*send p2p init packet with val_13=2*/
+		yahoo_send_p2p_pkt(p2p_data->gc, p2p_data->host_username, 2);/* send p2p init packet with val_13=2 */
 		
 		yahoo_p2p_disconnect_destroy_data(p2p_data);
 		return;
 	}
 
-	/*Add an Input Read event to the file descriptor*/
+	/* Add an Input Read event to the file descriptor */
 	p2p_data->input_event = purple_input_add(source, PURPLE_INPUT_READ, yahoo_p2p_read_pkt_cb, data);
 	p2p_data->source = source;
 
 	g_hash_table_insert(yd->peers, g_strdup(p2p_data->host_username), p2p_data);
 	
-	/*If the peer is a friend, set him connected*/
+	/* If the peer is a friend, set him connected */
 	f = yahoo_friend_find(p2p_data->gc, p2p_data->host_username);
 	if (f)
 		yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_WE_ARE_CLIENT);
 
 	account = purple_connection_get_account(p2p_data->gc);
 
-	/*Build the yahoo packet*/
+	/* Build the yahoo packet */
 	pkt_to_send = yahoo_packet_new(YAHOO_SERVICE_P2PFILEXFER, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	yahoo_packet_hash(pkt_to_send, "ssisi",
 		4, purple_normalize(account, purple_account_get_username(account)),
 		5, p2p_data->host_username,
-		241, 0,		/*Protocol identifier*/
+		241, 0,		/* Protocol identifier */
 		49, "PEERTOPEER",
-		13, 1);		/*we receive key13= 0 or 2, we send key13=1*/
+		13, 1);		/* we receive key13= 0 or 2, we send key13=1 */
 
-	yahoo_p2p_write_pkt(source, pkt_to_send);	/*build raw packet and send*/
+	yahoo_p2p_write_pkt(source, pkt_to_send);	/* build raw packet and send */
 	yahoo_packet_free(pkt_to_send);
 }
 
@@ -2638,7 +2638,7 @@ static void yahoo_process_p2p(PurpleConn
 			val_13 = strtol(pair->value, NULL, 10);
 			break;
 		case 11:
-			val_11 = strtol(pair->value, NULL, 10);		/*session id of peer*/
+			val_11 = strtol(pair->value, NULL, 10);		/* session id of peer */
 			if( (f = yahoo_friend_find(gc, who)) )
 				f->session_id = val_11;
 			break;
@@ -2698,7 +2698,7 @@ static void yahoo_process_p2p(PurpleConn
 		p2p_data->gc = gc;
 		p2p_data->connection_type = YAHOO_P2P_WE_ARE_CLIENT;
 
-		/*connect to host*/
+		/* connect to host */
 		if((purple_proxy_connect(NULL, account, host_ip, YAHOO_PAGER_PORT_P2P, yahoo_p2p_init_cb, p2p_data))==NULL)	{
 			yahoo_p2p_disconnect_destroy_data(p2p_data);
 			purple_debug_info("yahoo","p2p: Connection to %s failed\n", host_ip);
@@ -2864,8 +2864,8 @@ static void yahoo_packet_process(PurpleC
 		break;
 	case YAHOO_SERVICE_P2PFILEXFER:
 		/* This case had no break and continued; thus keeping it this way.*/
-		yahoo_process_p2p(gc, pkt);	/*P2PFILEXFER handled the same way as process_p2p*/
-		yahoo_process_p2pfilexfer(gc, pkt);	/*redundant ??, need to have a break now*/
+		yahoo_process_p2p(gc, pkt);	/* P2PFILEXFER handled the same way as process_p2p */
+		yahoo_process_p2pfilexfer(gc, pkt);	/* redundant ??, need to have a break now */
 	case YAHOO_SERVICE_FILETRANSFER:
 		yahoo_process_filetransfer(gc, pkt);
 		break;
@@ -3925,7 +3925,7 @@ yahoo_get_inbox_token_cb(PurpleUtilFetch
 	if (error_message != NULL)
 		purple_debug_error("yahoo", "Requesting mail login token failed: %s\n", error_message);
 	else if (len > 0 && webdata && *webdata) {
-		/*Extract token from the chunked webdata*/
+		/* Extract token from the chunked webdata */
 		sscanf(webdata,"%x",&token_size);
 		token = g_malloc(token_size);
 		strncpy(token, strstr(webdata,"\r\n")+2, token_size);
@@ -4093,14 +4093,14 @@ static int yahoo_send_im(PurpleConnectio
 
 	/* We may need to not send any packets over 2000 bytes, but I'm not sure yet. */
 	if ((YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt)) <= 2000)	{
-		/*if p2p link exists, send through it. To-do: key 15, time value to be sent in case of p2p*/
+		/* if p2p link exists, send through it. To-do: key 15, time value to be sent in case of p2p */
 		if( (p2p_data = g_hash_table_lookup(yd->peers, who)) )	{
 			yahoo_packet_hash_int(pkt, 11, p2p_data->session_id);
 			yahoo_p2p_write_pkt(p2p_data->source, pkt);
 		}
 		else	{
 			yahoo_packet_send(pkt, yd);
-			yahoo_send_p2p_pkt(gc, who, 0);		/*send p2p packet, with val_13=0*/
+			yahoo_send_p2p_pkt(gc, who, 0);		/* send p2p packet, with val_13=0 */
 		}
 	}
 	else
@@ -4121,15 +4121,15 @@ static unsigned int yahoo_send_typing(Pu
 
 	struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_NOTIFY, YAHOO_STATUS_TYPING, 0);
 
-	/*check to see if p2p link exists, send through it*/
+	/* check to see if p2p link exists, send through it */
 	if( (p2p_data = g_hash_table_lookup(yd->peers, who)) )	{
 		yahoo_packet_hash(pkt, "sssssis", 49, "TYPING", 1, purple_connection_get_display_name(gc),
 	                  14, " ", 13, state == PURPLE_TYPING ? "1" : "0",
-	                  5, who, 11, p2p_data->session_id, 1002, "1");	/*To-do: key 15 to be sent in case of p2p*/	
+	                  5, who, 11, p2p_data->session_id, 1002, "1");	/* To-do: key 15 to be sent in case of p2p */	
 		yahoo_p2p_write_pkt(p2p_data->source, pkt);
 		yahoo_packet_free(pkt);
 	}
-	else	{	/*send through yahoo server*/
+	else	{	/* send through yahoo server */
 		yahoo_packet_hash(pkt, "ssssss", 49, "TYPING", 1, purple_connection_get_display_name(gc),
 	                  14, " ", 13, state == PURPLE_TYPING ? "1" : "0",
 	                  5, who, 1002, "1");
@@ -4724,10 +4724,10 @@ static gboolean yahoo_uri_handler(const 
 				purple_conv_send_confirm(conv, message);
 			}
 		}
-		/*else
+		/* else
 			**If pidgindialogs_im() was in the core, we could use it here.
 			 * It is all purple_request_* based, but I'm not sure it really belongs in the core
-			pidgindialogs_im();*/
+			pidgindialogs_im(); */
 
 		return TRUE;
 	}
@@ -4741,7 +4741,7 @@ static gboolean yahoo_uri_handler(const 
 			g_hash_table_insert(params, g_strdup("type"), g_strdup("Chat"));
 			serv_join_chat(purple_account_get_connection(acct), params);
 		}
-		/*else
+		/* else
 			** Same as above (except that this would have to be re-written using purple_request_*)
 			pidgin_blist_joinchat_show(); */
 
@@ -4802,7 +4802,7 @@ static PurplePluginProtocolInfo prpl_inf
 	yahoo_add_buddy,
 	NULL, /* add_buddies */
 	yahoo_remove_buddy,
-	NULL, /*remove_buddies */
+	NULL, /* remove_buddies */
 	NULL, /* add_permit */
 	yahoo_add_deny,
 	NULL, /* rem_permit */
============================================================
--- libpurple/protocols/yahoo/yahoo.h	81848856a338918bfde0098e2ee4f3dacadc600c
+++ libpurple/protocols/yahoo/yahoo.h	b757a1f5971729e90147eadc400d11ee8d45537f
@@ -46,7 +46,7 @@
 #define YAHOOJP_MAIL_URL "http://mail.yahoo.co.jp/"
 #define YAHOOJP_XFER_HOST "filetransfer.msg.yahoo.co.jp"
 #define YAHOOJP_WEBCAM_HOST "wc.yahoo.co.jp"
-/*not sure, must test:*/
+/* not sure, must test: */
 #define YAHOOJP_XFER_RELAY_HOST "relay.msg.yahoo.co.jp" 
 #define YAHOOJP_XFER_RELAY_PORT 80
 #define YAHOOJP_ROOMLIST_URL "http://insider.msg.yahoo.co.jp/ycontent/"
@@ -189,15 +189,15 @@ struct yahoo_data {
 	 * for when we lookup people profile or photo information.
 	 */
 	GSList *url_datas;
-	GHashTable *xfer_peer_idstring_map;/*Hey, i dont know, but putting this HashTable next to friends gives a run time fault...*/
-	GSList *cookies;/*contains all cookies, including _y and _t*/
+	GHashTable *xfer_peer_idstring_map;/* Hey, i dont know, but putting this HashTable next to friends gives a run time fault... */
+	GSList *cookies;/* contains all cookies, including _y and _t */
 	
 	/**
 	 * We may receive a list15 in multiple packets with no prior warning as to how many we'll be getting;
 	 * the server expects us to keep track of the group for which it is sending us contact names.
 	 */
 	char *current_list15_grp;
-	GHashTable *peers;	/*information about p2p data*/
+	GHashTable *peers;	/* information about p2p data */
 	int yahoo_local_p2p_server_fd;
 	int yahoo_p2p_server_watcher;
 };
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	ec07c1ce3530436b7743bcd523644f20d0285206
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	6862f59a7f3fa1411ba82b39b6ebef96e8f8f762
@@ -51,7 +51,7 @@ struct yahoo_xfer_data {
 	guint rxlen;
 	gchar *xfer_peer_idstring;
 	gchar *xfer_idstring_for_relay;
-	int version; /*0 for old, 15 for Y7(YMSG 15)*/
+	int version; /* 0 for old, 15 for Y7(YMSG 15) */
 	int info_val_249;
 
 	enum {
@@ -68,7 +68,7 @@ struct yahoo_xfer_data {
 	/* contains all filenames, in case of multiple transfers, with the first
 	 * one in the list being the current file's name (ymsg15) */
 	GSList *filename_list;
-	GSList *size_list; /*corresponds to filename_list, with size as **STRING** */
+	GSList *size_list; /* corresponds to filename_list, with size as **STRING** */
 	gboolean firstoflist;
 	gchar *xfer_url;	/* url of the file, used when we are p2p server */
 	int yahoo_local_p2p_ft_server_fd;
@@ -87,14 +87,14 @@ static void yahoo_xfer_data_free(struct 
 	gc = xd->gc;
 	yd = gc->proto_data;
 
-	/*remove entry from map*/
+	/* remove entry from map */
 	if(xd->xfer_peer_idstring) {
 		xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, xd->xfer_peer_idstring);
 		if(xfer)
 			g_hash_table_remove(yd->xfer_peer_idstring_map, xd->xfer_peer_idstring);
 	}
 
-	/*empty file & filesize list*/
+	/* empty file & filesize list */
 	for (l = xd->filename_list; l; l = l->next) {
 		g_free(l->data);
 		l->data=NULL;
@@ -693,7 +693,7 @@ static void yahoo_xfer_end(PurpleXfer *x
 				purple_xfer_set_write_fnc(xfer,       yahoo_xfer_write);
 				purple_xfer_set_request_denied_fnc(xfer,yahoo_xfer_cancel_recv);
 
-				/*update map to current xfer*/
+				/* update map to current xfer */
 				g_hash_table_remove(yd->xfer_peer_idstring_map, xfer_data->xfer_peer_idstring);
 				g_hash_table_insert(yd->xfer_peer_idstring_map, xfer_data->xfer_peer_idstring, xfer);
 
@@ -989,7 +989,7 @@ static void yahoo_xfer_dns_connected_15(
 		return;
 	}
 	
-	/*TODO:actually, u must try with addr no.1 , if its not working addr no.2 .....*/
+	/* TODO:actually, u must try with addr no.1 , if its not working addr no.2 ..... */
 	addr = hosts->data;
 	actaddr = addr->sin_addr.s_addr;
 	d = actaddr % 256;
@@ -1071,7 +1071,7 @@ static void yahoo_p2p_ft_server_listen_c
 }
 
 static void yahoo_p2p_ft_server_listen_cb(int listenfd, gpointer data);	/* using this in yahoo_xfer_send_cb_15 */
-static void yahoo_xfer_connected_15(gpointer data, gint source, const gchar *error_message);/*using this in recv_cb*/
+static void yahoo_xfer_connected_15(gpointer data, gint source, const gchar *error_message);/* using this in recv_cb */
 
 static void yahoo_xfer_recv_cb_15(gpointer data, gint source, PurpleInputCondition condition)
 {
@@ -1112,7 +1112,7 @@ static void yahoo_xfer_recv_cb_15(gpoint
 
 	if(xd->status_15 == HEAD_REQUESTED) {
 		xd->status_15 = HEAD_REPLY_RECEIVED;
-		close(source);/*Is this required?*/
+		close(source);/* Is this required? */
 		g_free(xd->txbuf);
 		xd->txbuf = NULL;
 		if (purple_proxy_connect(NULL, account, xd->host, xd->port, yahoo_xfer_connected_15, xfer) == NULL)
@@ -1227,15 +1227,15 @@ static void yahoo_xfer_connected_15(gpoi
 		{
 			if(xd->info_val_249 == 2)
 				{
-				/*sending file via p2p, we are connected as client*/
+				/* sending file via p2p, we are connected as client */
 				xd->txbuf = g_strdup_printf("POST /%s HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost: %s\r\nContent-Length: %ld\r\nCache-Control: no-cache\r\n\r\n",
 										xd->path,
 										xd->host,
-										(long int)xfer->size);	/*to do, add Referer*/
+										(long int)xfer->size);	/* to do, add Referer */
 				}
 			else
 				{
-				/*sending file via relaying*/
+				/* sending file via relaying */
 				xd->txbuf = g_strdup_printf("POST /relay?token=%s&sender=%s&recver=%s HTTP/1.1\r\nCookie:%s\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost: %s\r\nContent-Length: %ld\r\nCache-Control: no-cache\r\n\r\n",
 										purple_url_encode(xd->xfer_idstring_for_relay),
 										purple_normalize(account, purple_account_get_username(account)),
@@ -1249,12 +1249,12 @@ static void yahoo_xfer_connected_15(gpoi
 		{	
 			if(xd->info_val_249 == 1)
 				{
-				/*receiving file via p2p, connected as client*/
+				/* receiving file via p2p, connected as client */
 				xd->txbuf = g_strdup_printf("HEAD /%s HTTP/1.1\r\nAccept:*/*\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost: %s\r\nContent-Length: 0\r\nCache-Control: no-cache\r\n\r\n",xd->path,xd->host);
 			}
 			else
 				{
-				/*receiving file via relaying*/
+				/* receiving file via relaying */
 				xd->txbuf = g_strdup_printf("HEAD /relay?token=%s&sender=%s&recver=%s HTTP/1.1\r\nAccept:*/*\r\nCookie:%s\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost:%s\r\nContent-Length: 0\r\nCache-Control: no-cache\r\n\r\n",
 										purple_url_encode(xd->xfer_idstring_for_relay),
 										purple_normalize(account, purple_account_get_username(account)),
@@ -1267,12 +1267,12 @@ static void yahoo_xfer_connected_15(gpoi
 		{
 			if(xd->info_val_249 == 1)
 				{
-				/*receiving file via p2p, connected as client*/
+				/* receiving file via p2p, connected as client */
 				xd->txbuf = g_strdup_printf("GET /%s HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost: %s\r\nConnection: Keep-Alive\r\n\r\n",xd->path,xd->host);
 			}
 			else
 				{
-				/*receiving file via relaying*/
+				/* receiving file via relaying */
 				xd->txbuf = g_strdup_printf("GET /relay?token=%s&sender=%s&recver=%s HTTP/1.1\r\nCookie:%s\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost:%s\r\nConnection: Keep-Alive\r\n\r\n",
 										purple_url_encode(xd->xfer_idstring_for_relay),
 										purple_normalize(account, purple_account_get_username(account)),
@@ -1398,17 +1398,17 @@ static void yahoo_p2p_ft_server_send_con
 	else if(acceptfd == -1) {
 		purple_debug_warning("yahoo","yahoo_p2p_server_send_connected_cb: accept: %s\n", g_strerror(errno));
 		purple_xfer_cancel_remote(xfer);
-		/*remove watcher and close p2p ft server*/
+		/* remove watcher and close p2p ft server */
 		purple_input_remove(xd->yahoo_p2p_ft_server_watcher);
 		close(xd->yahoo_local_p2p_ft_server_fd);
 		return;
 	}
 
-	/*remove watcher and close p2p ft server*/
+	/* remove watcher and close p2p ft server */
 	purple_input_remove(xd->yahoo_p2p_ft_server_watcher);
 	close(xd->yahoo_local_p2p_ft_server_fd);
 
-	/*Add an Input Read event to the file descriptor*/
+	/* Add an Input Read event to the file descriptor */
 	xfer->fd = acceptfd;
 	if(xfer->type == PURPLE_XFER_RECEIVE)
 		xd->input_event = purple_input_add(acceptfd, PURPLE_INPUT_READ, yahoo_p2p_ft_POST_cb, data);
@@ -1566,14 +1566,14 @@ void yahoo_process_filetrans_15(PurpleCo
 			/* 1=send, 2=cancel, 3=accept, 4=reject */ 
 			break;
 
-		/*check for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it.*/
+		/* check for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it. */
 		case 49:
 			service = pair->value;
 			break;
 		case 63:
 			imv = pair->value;
 			break;
-		/*end check*/
+		/* end check */
 
 		}
 	}
@@ -1604,7 +1604,7 @@ void yahoo_process_filetrans_15(PurpleCo
 		
 		/* To send through p2p */
 		if( g_hash_table_lookup(yd->peers, from) )	{
-			/*send p2p file transfer information */
+			/* send p2p file transfer information */
 			yahoo_p2p_client_send_ft_info(gc, xfer);
 			return;
 		}
@@ -1622,7 +1622,7 @@ void yahoo_process_filetrans_15(PurpleCo
 		return;
 	}
 
-	/*processing for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it.*/
+	/* processing for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it. */
 	/*
 	* The remote user has changed their IMVironment.  We
 	* record it for later use.
@@ -1638,7 +1638,7 @@ void yahoo_process_filetrans_15(PurpleCo
 			return;
 		}
 	}
-	/*end processing*/
+	/* end processing */
 
 	if(!filename_list)
 		return;
@@ -1807,7 +1807,7 @@ void yahoo_process_filetrans_info_15(Pur
 	}
 }
 
-/*TODO: Check filename etc. No probs till some hacker comes in the way*/
+/* TODO: Check filename etc. No probs till some hacker comes in the way */
 void yahoo_process_filetrans_acc_15(PurpleConnection *gc, struct yahoo_packet *pkt)
 {
 	gchar *xfer_peer_idstring = NULL;
@@ -1839,7 +1839,7 @@ void yahoo_process_filetrans_acc_15(Purp
 			val_249 = atol(pair->value);
 			break;
 		case 250:
-			url = pair->value;	/*we get a p2p url here when sending file, connected as client*/
+			url = pair->value;	/* we get a p2p url here when sending file, connected as client */
 			break;
 		}
 	}
============================================================
--- libpurple/protocols/yahoo/yahoo_friend.h	3794f5104b05e3e3f0fb67be00f5d15bd6d5850a
+++ libpurple/protocols/yahoo/yahoo_friend.h	8c04482956a05a092453b32c7698dd1f855f74b9
@@ -58,8 +58,8 @@ typedef struct _YahooFriend {
 	long int version_id;
 	gchar *alias_id;
 	YahooP2PStatus p2p_status;
-	gboolean p2p_packet_sent;	/*0:not sent, 1=sent*/
-	gint session_id;	/*session id of friend*/
+	gboolean p2p_packet_sent;	/* 0:not sent, 1=sent */
+	gint session_id;	/* session id of friend */
 } YahooFriend;
 
 YahooFriend *yahoo_friend_find(PurpleConnection *gc, const char *name);
============================================================
--- libpurple/protocols/yahoo/yahoo_packet.h	6343ec52f020c7e1d8266b6ae808c528ec9004cd
+++ libpurple/protocols/yahoo/yahoo_packet.h	7126003598273c97bf04bed84ce07cc6da28b22e
@@ -98,18 +98,18 @@ enum yahoo_service { /* these are easier
 	YAHOO_SERVICE_AVATAR_UPDATE = 0xc7,
 	YAHOO_SERVICE_VERIFY_ID_EXISTS = 0xc8,
 	YAHOO_SERVICE_AUDIBLE = 0xd0,
-	/*YAHOO_SERVICE_CHAT_SESSION = 0xd4,?? Reports start of chat session, gets an id from server*/
+	/* YAHOO_SERVICE_CHAT_SESSION = 0xd4,?? Reports start of chat session, gets an id from server */
 	YAHOO_SERVICE_AUTH_REQ_15 = 0xd6,
 	YAHOO_SERVICE_FILETRANS_15 = 0xdc,
 	YAHOO_SERVICE_FILETRANS_INFO_15 = 0xdd,
 	YAHOO_SERVICE_FILETRANS_ACC_15 = 0xde,
-	/*photo sharing services ?? - 0xd2, 0xd7, 0xd8, 0xda*/
+	/* photo sharing services ?? - 0xd2, 0xd7, 0xd8, 0xda */
 	YAHOO_SERVICE_CHGRP_15 = 0xe7,
 	YAHOO_SERVICE_STATUS_15 = 0xf0,
 	YAHOO_SERVICE_LIST_15 = 0xf1,
 	YAHOO_SERVICE_WEBLOGIN = 0x0226,
 	YAHOO_SERVICE_SMS_MSG = 0x02ea
-	/*YAHOO_SERVICE_DISCONNECT = 0x07d1 Server forces us to disconnect. Is sent with TCP FIN flag set*/
+	/* YAHOO_SERVICE_DISCONNECT = 0x07d1 Server forces us to disconnect. Is sent with TCP FIN flag set */
 };
 
 struct yahoo_pair {


More information about the Commits mailing list