changeset 31264:f4c86572e745

Fix debug_*_to_file to process SlpMessages instead of MsnMessages.
author masca@cpw.pidgin.im
date Tue, 22 Jun 2010 23:09:36 +0000
parents 91ba047e838c
children 4e0593a35b8c
files libpurple/protocols/msn/slplink.c
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slplink.c	Tue Jun 22 23:00:10 2010 +0000
+++ b/libpurple/protocols/msn/slplink.c	Tue Jun 22 23:09:36 2010 +0000
@@ -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,10 +333,10 @@
 	/* 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);
-#endif
+	debug_part_to_file(slpmsg, TRUE);
 #endif
 
 	slpmsg->parts = g_list_append(slpmsg->parts, part);