changeset 30845:6e7a0e87d589

Print SLP data as text if it's a negociating session message.
author masca@cpw.pidgin.im
date Tue, 06 Jul 2010 18:51:44 +0000
parents 7b1b7a4e0bb4
children e0c374ad8fd3
files libpurple/protocols/msn/msg.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msg.c	Mon Jul 05 22:00:10 2010 +0000
+++ b/libpurple/protocols/msn/msg.c	Tue Jul 06 18:51:44 2010 +0000
@@ -652,17 +652,27 @@
 			else
 			{
 				int i;
-				for (i = 0; i < msg->body_len; i++)
+				int bin_len;
+				
+				if (msg->part->footer->value == P2P_APPID_SESION)
+					bin_len = P2P_PACKET_HEADER_SIZE;
+				else
+					bin_len = body_len;
+
+				for (i = 0; i < bin_len; i++)
 				{
 					g_string_append_printf(str, "%.2hhX ", body[i]);
 					if ((i % 16) == 15)
 						g_string_append(str, "\r\n");
 				}
+
+				if (bin_len == P2P_PACKET_HEADER_SIZE)
+					g_string_append_printf(str, "%s ", body + P2P_PACKET_HEADER_SIZE);
 				g_string_append(str, "\r\n");
 			}
 		}
 
-		g_string_append_printf(str, "Footer:     %u\r\n", msg->part->footer->value);
+		g_string_append_printf(str, "Footer:     0x%08X\r\n", msg->part->footer->value);
 	}
 	else
 	{