soc.2010.msn-tlc: 3a9d3cac: Migrate MsnMessage code to use Parts ins...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Wed Jun 16 19:15:57 EDT 2010


-----------------------------------------------------------------
Revision: 3a9d3cac5779d90239da0ec1ccaf190effa5618f
Ancestor: d8d1a7f9f306bf0ffba2783a2b35b8b33f7257e6
Author: masca at cpw.pidgin.im
Date: 2010-06-16T22:12:07
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/3a9d3cac5779d90239da0ec1ccaf190effa5618f

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

ChangeLog: 

Migrate MsnMessage code to use Parts instead of the whole SlpMessage.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msg.c	88db0d7df39a36a39fa3b2c1cad25a6952d0bdb9
+++ libpurple/protocols/msn/msg.c	506dee5dbad362381db6dcdf0adf19d4fa0b520d
@@ -259,7 +259,7 @@ msn_message_parse_payload(MsnMessage *ms
 	if (content_type != NULL &&
 		!strcmp(content_type, "application/x-msnmsgrp2p")) {
 		msg->msnslp_message = TRUE;
-		msg->slpmsg = msn_slpmsg_new_from_data(tmp, payload_len - (tmp - tmp_base));
+		msg->part = msn_slpmsgpart_new_from_data(tmp, payload_len - (tmp - tmp_base));
 	}
 
 	if (payload_len - (tmp - tmp_base) > 0) {
@@ -303,7 +303,7 @@ msn_message_gen_slp_body(MsnMessage *msg
 {
 	char *tmp;
 
-	tmp = msn_slpmsg_serialize(msg->slpmsg, ret_size);
+	tmp = msn_slpmsgpart_serialize(msg->part, ret_size);
 	return tmp;
 }
 
@@ -362,7 +362,7 @@ msn_message_gen_payload(MsnMessage *msg,
 		size_t siz;
 		char *body;
 		
-		body = msn_slpmsg_serialize(msg->slpmsg, &siz);
+		body = msn_slpmsgpart_serialize(msg->part, &siz);
 
 		memcpy(n, body, siz);
 		n += siz;
@@ -625,15 +625,15 @@ msn_message_show_readable(MsnMessage *ms
 
 	if (msg->msnslp_message)
 	{
-		g_string_append_printf(str, "Session ID: %u\r\n", msg->slpmsg->header->session_id);
-		g_string_append_printf(str, "ID:         %u\r\n", msg->slpmsg->header->id);
-		g_string_append_printf(str, "Offset:     %" G_GUINT64_FORMAT "\r\n", msg->slpmsg->header->offset);
-		g_string_append_printf(str, "Total size: %" G_GUINT64_FORMAT "\r\n", msg->slpmsg->header->total_size);
-		g_string_append_printf(str, "Length:     %u\r\n", msg->slpmsg->header->length);
-		g_string_append_printf(str, "Flags:      0x%x\r\n", msg->slpmsg->header->flags);
-		g_string_append_printf(str, "ACK ID:     %u\r\n", msg->slpmsg->header->ack_id);
-		g_string_append_printf(str, "SUB ID:     %u\r\n", msg->slpmsg->header->ack_sub_id);
-		g_string_append_printf(str, "ACK Size:   %" G_GUINT64_FORMAT "\r\n", msg->slpmsg->header->ack_size);
+		g_string_append_printf(str, "Session ID: %u\r\n", msg->part->header->session_id);
+		g_string_append_printf(str, "ID:         %u\r\n", msg->part->header->id);
+		g_string_append_printf(str, "Offset:     %" G_GUINT64_FORMAT "\r\n", msg->part->header->offset);
+		g_string_append_printf(str, "Total size: %" G_GUINT64_FORMAT "\r\n", msg->part->header->total_size);
+		g_string_append_printf(str, "Length:     %u\r\n", msg->part->header->length);
+		g_string_append_printf(str, "Flags:      0x%x\r\n", msg->part->header->flags);
+		g_string_append_printf(str, "ACK ID:     %u\r\n", msg->part->header->ack_id);
+		g_string_append_printf(str, "SUB ID:     %u\r\n", msg->part->header->ack_sub_id);
+		g_string_append_printf(str, "ACK Size:   %" G_GUINT64_FORMAT "\r\n", msg->part->header->ack_size);
 
 		if (purple_debug_is_verbose() && body != NULL)
 		{
@@ -660,7 +660,7 @@ msn_message_show_readable(MsnMessage *ms
 			}
 		}
 
-		g_string_append_printf(str, "Footer:     %u\r\n", msg->slpmsg->footer->value);
+		g_string_append_printf(str, "Footer:     %u\r\n", msg->part->footer->value);
 	}
 	else
 	{


More information about the Commits mailing list