cpw.qulogic.msn: 738e1d83: I was getting annoyed with this extra pr...

qulogic at pidgin.im qulogic at pidgin.im
Sat Jun 7 04:10:57 EDT 2008


-----------------------------------------------------------------
Revision: 738e1d83d6a690135e101c9612aee628c1b65601
Ancestor: 954f3b1298946ba4e06f68bc12bf2b48609e2931
Author: qulogic at pidgin.im
Date: 2008-06-07T04:05:25
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/738e1d83d6a690135e101c9612aee628c1b65601

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

ChangeLog: 

I was getting annoyed with this extra printing, so now on MSN, it only 
print a command's payload length when it's a command that is actually 
supposed to contain a payload.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/command.c	8ee8a3a61b15e0c7ce616e449c7a76f4988a2230
+++ libpurple/protocols/msn/command.c	54bb388e33c487a6294b2953daa2c1b11b6149fb
@@ -69,18 +69,22 @@ msn_check_payload_cmd(const char *str)
 /*
  * set command Payload length
  */
-static void
+static gboolean
 msn_set_payload_len(MsnCommand *cmd)
 {
 	char *param;
 	int len = 0;
+	gboolean has_payload = FALSE;
 
 	if (msn_check_payload_cmd(cmd->command) && (cmd->param_count > 0)){
 		param = cmd->params[cmd->param_count - 1];
 		len = is_num(param) ? atoi(param) : 0;
+		has_payload = TRUE;
 	}
 
 	cmd->payload_len = len;
+
+	return has_payload;
 }
 
 MsnCommand *
@@ -120,8 +124,8 @@ msn_command_from_string(const char *stri
 
 	/* khc: Huh! */
 	/*add payload Length checking*/
-	msn_set_payload_len(cmd);
-	purple_debug_info("MSNP14","get payload len:%" G_GSIZE_FORMAT "\n", cmd->payload_len);
+	if (msn_set_payload_len(cmd))
+		purple_debug_info("MSNP14","get payload len:%" G_GSIZE_FORMAT "\n", cmd->payload_len);
 
 	msn_command_ref(cmd);
 


More information about the Commits mailing list