cpw.qulogic.msn: 197e49f9: Remove some MSN code duplication in proc...

qulogic at pidgin.im qulogic at pidgin.im
Mon Jun 23 01:56:31 EDT 2008


-----------------------------------------------------------------
Revision: 197e49f9518c8484730609cd64454f5ff9d0090b
Ancestor: d739b6fb6b24e22a1b79285a5b5d1d8a457b3a24
Author: qulogic at pidgin.im
Date: 2008-06-23T00:54:05
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/197e49f9518c8484730609cd64454f5ff9d0090b

Modified files:
        libpurple/protocols/msn/notification.c

ChangeLog: 

Remove some MSN code duplication in processing messages from Yahoo 
buddies and fix a typo, I think. I don't have any Yahoo buddies to test 
this, though.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	569d15500cfeb7e0bde8b2149cdd70531b4c0e20
+++ libpurple/protocols/msn/notification.c	86cdf9539d9842b93ae731f363557adef3bdd5a2
@@ -360,7 +360,7 @@ msg_cmd_post(MsnCmdProc *cmdproc, MsnCom
 
 	msg = msn_message_new_from_cmd(cmdproc->session, cmd);
 
-	msn_message_parse_payload(msg, payload, len,MSG_LINE_DEM,MSG_BODY_DEM);
+	msn_message_parse_payload(msg, payload, len, MSG_LINE_DEM, MSG_BODY_DEM);
 #ifdef MSN_DEBUG_NS
 	msn_message_show_readable(msg, "Notification", TRUE);
 #endif
@@ -374,18 +374,16 @@ msg_cmd(MsnCmdProc *cmdproc, MsnCommand 
 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
 	purple_debug_info("MSNP14","Processing MSG... \n");
-	if(cmd->payload_len == 0){
+	if (cmd->payload_len == 0) {
 		return;
 	}
 	/* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued
 	 * command and we are processing it */
-	if (cmd->payload == NULL)
-	{
+	if (cmd->payload == NULL) {
 		cmdproc->last_cmd->payload_cb  = msg_cmd_post;
 		cmdproc->servconn->payload_len = atoi(cmd->params[2]);
-	}
-	else
-	{
+
+	} else {
 		g_return_if_fail(cmd->payload_cb != NULL);
 
 #if 0 /* glib on win32 doesn't correctly support precision modifiers for a string */
@@ -418,6 +416,7 @@ uum_send_msg(MsnSession *session,MsnMess
 	msn_cmdproc_send_trans(cmdproc, trans);
 }
 
+#if 0
 static void
 ubm_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
 			 size_t len)
@@ -491,25 +490,26 @@ ubm_cmd_post(MsnCmdProc *cmdproc, MsnCom
 	}
 	msn_message_destroy(msg);
 }
+#endif
 
 /*Yahoo msg process*/
 static void
 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
 	purple_debug_info("MSNP14","Processing UBM... \n");
-	if(cmd->payload_len == 0){
+	if (cmd->payload_len == 0) {
 		return;
 	}
 	/* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued
 	 * command and we are processing it */
-	if (cmd->payload == NULL){
-		cmdproc->last_cmd->payload_cb  = ubm_cmd_post;
-		cmdproc->servconn->payload_len = atoi(cmd->params[2]);
-	}else{
+	if (cmd->payload == NULL ){
+		cmdproc->last_cmd->payload_cb  = msg_cmd_post;
+		cmdproc->servconn->payload_len = atoi(cmd->params[4]);
+	} else {
 		g_return_if_fail(cmd->payload_cb != NULL);
 
 		purple_debug_info("MSNP14", "UBM payload:{%.*s}\n", (guint)(cmd->payload_len), cmd->payload);
-		ubm_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len);
+		msg_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len);
 	}
 }
 


More information about the Commits mailing list