soc.2010.msn-tlc: ef1ec79e: Remove the MsnMessage from SlpMessage.

masca at cpw.pidgin.im masca at cpw.pidgin.im
Mon Jun 21 03:17:11 EDT 2010


-----------------------------------------------------------------
Revision: ef1ec79ec7bacfba4244de8f1474021352be06f0
Ancestor: d90ae2a31ff17ac4d4b3f1c0db29145e88a1c69f
Author: masca at cpw.pidgin.im
Date: 2010-06-19T21:48:19
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/ef1ec79ec7bacfba4244de8f1474021352be06f0

Modified files:
        libpurple/protocols/msn/sbconn.c
        libpurple/protocols/msn/slp.c
        libpurple/protocols/msn/slplink.c
        libpurple/protocols/msn/slpmsg.h

ChangeLog: 

Remove the MsnMessage from SlpMessage.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/sbconn.c	5484cf31f72d32cf9f76fb0b9fca160bd6947ded
+++ libpurple/protocols/msn/sbconn.c	bd38630117064279b8f8a219a5967bf70992466d
@@ -81,11 +81,15 @@ void msn_sbconn_send_part(MsnSlpLink *sl
 void msn_sbconn_send_part(MsnSlpLink *slplink, MsnSlpMessagePart *part)
 {
 	MsnMessage *msg;
+	const char *passport;
 	char *data;
 	size_t size;
 
 	msg = msn_message_new_msnslp();
 
+	passport = purple_normalize(slplink->session->account, slplink->remote_user);
+	msn_message_set_header(msg, "P2P-Dest", passport);
+
 	data = msn_slpmsgpart_serialize(part, &size);
 	msg->part = part;
 
============================================================
--- libpurple/protocols/msn/slp.c	a8e774e30628bbae5db4db7c25dc36582df5647e
+++ libpurple/protocols/msn/slp.c	566706c15aac465da1b645169439702d0afb3997
@@ -155,7 +155,6 @@ msn_xfer_write(const guchar *data, gsize
 	slpcall->u.outgoing.len = len;
 	slpcall->u.outgoing.data = data;
 	msn_slplink_send_msgpart(slpcall->slplink, slpcall->xfer_msg);
-	msn_message_unref(slpcall->xfer_msg->msg);
 	return MIN(1202, len);
 }
 
============================================================
--- libpurple/protocols/msn/slplink.c	a6c7afef02f2f0fb269f284a1c43e7342a38748e
+++ libpurple/protocols/msn/slplink.c	945ae5fa51cebbc2ddb31598b698464ddf528a38
@@ -34,6 +34,7 @@
 #include "slp.h"
 #include "p2p.h"
 
+#if 0
 #ifdef MSN_DEBUG_SLP_FILES
 static int m_sc = 0;
 static int m_rc = 0;
@@ -58,6 +59,7 @@ debug_msg_to_file(MsnMessage *msg, gbool
 	g_free(tmp);
 }
 #endif
+#endif /* 0 */
 
 /**************************************************************************
  * Main
@@ -333,11 +335,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);
 #endif
+#endif
 
 	slpmsg->parts = g_list_append(slpmsg->parts, part);
 	msn_slplink_send_part(slplink, part);
@@ -362,26 +364,21 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
 static void
 msn_slplink_release_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg)
 {
-	MsnMessage *msg;
-	const char *passport;
+	slpmsg = slpmsg;
+	slpmsg->header = g_new0(MsnP2PHeader, 1);
+	slpmsg->footer = g_new0(MsnP2PFooter, 1);
 
-	slpmsg->msg = msg = msn_message_new_msnslp();
-
-	msg->slpmsg = slpmsg;
-	msg->slpmsg->header = g_new0(MsnP2PHeader, 1);
-	msg->slpmsg->footer = g_new0(MsnP2PFooter, 1);
-
 	if (slpmsg->flags == P2P_NO_FLAG)
 	{
-		msg->slpmsg->header->session_id = slpmsg->session_id;
-		msg->slpmsg->header->ack_id = rand() % 0xFFFFFF00;
+		slpmsg->header->session_id = slpmsg->session_id;
+		slpmsg->header->ack_id = rand() % 0xFFFFFF00;
 	}
 	else if (slpmsg->flags == P2P_ACK)
 	{
-		msg->slpmsg->header->session_id = slpmsg->session_id;
-		msg->slpmsg->header->ack_id = slpmsg->ack_id;
-		msg->slpmsg->header->ack_size = slpmsg->ack_size;
-		msg->slpmsg->header->ack_sub_id = slpmsg->ack_sub_id;
+		slpmsg->header->session_id = slpmsg->session_id;
+		slpmsg->header->ack_id = slpmsg->ack_id;
+		slpmsg->header->ack_size = slpmsg->ack_size;
+		slpmsg->header->ack_sub_id = slpmsg->ack_sub_id;
 	}
 	else if (slpmsg->flags == P2P_MSN_OBJ_DATA ||
 	         slpmsg->flags == (P2P_WML2009_COMP | P2P_MSN_OBJ_DATA) ||
@@ -391,22 +388,25 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
 		slpcall = slpmsg->slpcall;
 
 		g_return_if_fail(slpcall != NULL);
-		msg->slpmsg->header->session_id = slpcall->session_id;
-		msg->slpmsg->footer->value = slpcall->app_id;
-		msg->slpmsg->header->ack_id = rand() % 0xFFFFFF00;
+		slpmsg->header->session_id = slpcall->session_id;
+		slpmsg->footer->value = slpcall->app_id;
+		slpmsg->header->ack_id = rand() % 0xFFFFFF00;
 	}
 	else if (slpmsg->flags == 0x100)
 	{
-		msg->slpmsg->header->ack_id     = slpmsg->ack_id;
-		msg->slpmsg->header->ack_sub_id = slpmsg->ack_sub_id;
-		msg->slpmsg->header->ack_size   = slpmsg->ack_size;
+		slpmsg->header->ack_id     = slpmsg->ack_id;
+		slpmsg->header->ack_sub_id = slpmsg->ack_sub_id;
+		slpmsg->header->ack_size   = slpmsg->ack_size;
 	}
 
-	msg->slpmsg->header->id = slpmsg->id;
-	msg->slpmsg->header->flags = (guint32)slpmsg->flags;
+	slpmsg->header->id = slpmsg->id;
+	slpmsg->header->flags = (guint32)slpmsg->flags;
 
-	msg->slpmsg->header->total_size = slpmsg->size;
+	slpmsg->header->total_size = slpmsg->size;
 
+	msn_slplink_send_msgpart(slplink, slpmsg);
+
+#if 0
 	passport = purple_normalize(slplink->session->account, slplink->remote_user);
 	msn_message_set_header(msg, "P2P-Dest", passport);
 
@@ -417,6 +417,7 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
 	msn_slplink_send_msgpart(slplink, slpmsg);
 
 	msn_message_destroy(msg);
+#endif
 }
 
 void
============================================================
--- libpurple/protocols/msn/slpmsg.h	d60d32f062d450afdec8afd94bb3ec9fb06b6335
+++ libpurple/protocols/msn/slpmsg.h	17044df4ef608ad97a51860650298bf641f425c9
@@ -78,7 +78,7 @@ struct _MsnSlpMessage
 	GList *msgs; /**< The real messages. */
 	GList *parts; /**< A list with the SlpMsgParts */
 
-#if 1
+#if 0
 	MsnMessage *msg; /**< The temporary real message that will be sent. */
 #endif
 


More information about the Commits mailing list