soc.2010.msn-tlc: fc67083e: Fix debug_*_to_file to process SlpMessag...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Thu Jun 24 02:17:03 EDT 2010


-----------------------------------------------------------------
Revision: fc67083e931c5aa65573eaa069c0bb28f1dc9b9d
Ancestor: 07bffe8f618593d5af66f72274a5bbe6e6aea860
Author: masca at cpw.pidgin.im
Date: 2010-06-22T23:09:36
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/fc67083e931c5aa65573eaa069c0bb28f1dc9b9d

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

ChangeLog: 

Fix debug_*_to_file to process SlpMessages instead of MsnMessages.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c	945ae5fa51cebbc2ddb31598b698464ddf528a38
+++ libpurple/protocols/msn/slplink.c	b2e4fce6641d29ce86a42c77a73dee7b6e817b33
@@ -34,32 +34,30 @@
 #include "slp.h"
 #include "p2p.h"
 
-#if 0
 #ifdef MSN_DEBUG_SLP_FILES
 static int m_sc = 0;
 static int m_rc = 0;
 
 static void
-debug_msg_to_file(MsnMessage *msg, gboolean send)
+debug_part_to_file(MsnSlpMessage *msg, gboolean send)
 {
 	char *tmp;
 	char *dir;
-	char *pload;
+	char *data;
 	int c;
-	gsize pload_size;
+	gsize data_size;
 
 	dir = send ? "send" : "recv";
 	c = send ? m_sc++ : m_rc++;
 	tmp = g_strdup_printf("%s/msntest/%s/%03d", g_get_home_dir(), dir, c);
-	pload = msn_message_gen_payload(msg, &pload_size);
-	if (!purple_util_write_data_to_file_absolute(tmp, pload, pload_size))
+	data = msn_slpmsg_serialize(msg, &data_size);
+	if (!purple_util_write_data_to_file_absolute(tmp, data, data_size))
 	{
 		purple_debug_error("msn", "could not save debug file\n");
 	}
 	g_free(tmp);
 }
 #endif
-#endif /* 0 */
 
 /**************************************************************************
  * Main
@@ -335,11 +333,11 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
 	/* TODO: port this function to SlpMessageParts */
 	if (purple_debug_is_verbose())
 		msn_message_show_readable(msg, slpmsg->info, slpmsg->text_body);
+#endif
 
 #ifdef MSN_DEBUG_SLP_FILES
-	debug_msg_to_file(msg, TRUE);
+	debug_part_to_file(slpmsg, TRUE);
 #endif
-#endif
 
 	slpmsg->parts = g_list_append(slpmsg->parts, part);
 	msn_slplink_send_part(slplink, part);


More information about the Commits mailing list