soc.2010.msn-tlc: 209cf23b: Print SLP data as text if it's a negocia...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Wed Jul 7 21:41:27 EDT 2010


----------------------------------------------------------------------
Revision: 209cf23bbac37a5699d243b8461cb70d97587895
Parent:   aa41868663429716c31b407a0cc52e73c7fd2a65
Author:   masca at cpw.pidgin.im
Date:     07/06/10 14:51:44
Branch:   im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/209cf23bbac37a5699d243b8461cb70d97587895

Changelog: 

Print SLP data as text if it's a negociating session message.

Changes against parent aa41868663429716c31b407a0cc52e73c7fd2a65

  patched  libpurple/protocols/msn/msg.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msg.c	daf167418ab6b625b9aae2c1ad1efa3173800f3c
+++ libpurple/protocols/msn/msg.c	10a44697e267b08126d6240f0ef96167228e56d8
@@ -652,17 +652,27 @@ msn_message_show_readable(MsnMessage *ms
 			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
 	{


More information about the Commits mailing list