soc.2010.msn-tlc: 1bb6e44c: Remove all unneeded MsnMessage related c...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Thu Jun 24 02:16:32 EDT 2010


-----------------------------------------------------------------
Revision: 1bb6e44c1f4a5d2c5f515fb88a08c7430250a007
Ancestor: 32c75f2da03ed189cfae04c8683907fbc59f40ec
Author: masca at cpw.pidgin.im
Date: 2010-06-23T22:47:49
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/1bb6e44c1f4a5d2c5f515fb88a08c7430250a007

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

ChangeLog: 

Remove all unneeded MsnMessage related code that was replaced by SlpParts.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/sbconn.c	485832d2a7106cd14362654a0c00108c149eb735
+++ libpurple/protocols/msn/sbconn.c	815264a77ef3b2e69094d7849614c5fa52066c30
@@ -4,83 +4,6 @@
 #include "msg.h"
 #include "sbconn.h"
 
-#if 0
-/* We have received the message ack */
-void
-msn_sbconn_msg_ack(MsnMessage *msg, void *data)
-{
-	MsnSlpMessage *slpmsg;
-	long long real_size;
-
-	slpmsg = data;
-
-	real_size = (slpmsg->flags == P2P_ACK) ? 0 : slpmsg->size;
-
-	slpmsg->offset += msg->slpmsg->header->length;
-
-	slpmsg->msgs = g_list_remove(slpmsg->msgs, msg);
-
-	if (slpmsg->offset < real_size)
-	{
-		if (slpmsg->slpcall->xfer && purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED)
-		{
-			slpmsg->slpcall->xfer_msg = slpmsg;
-			msn_message_ref(msg);
-			purple_xfer_prpl_ready(slpmsg->slpcall->xfer);
-		}
-		else
-			msn_slplink_send_msgpart(slpmsg->slplink, slpmsg);
-	}
-	else
-	{
-		/* The whole message has been sent */
-		if (slpmsg->flags == P2P_MSN_OBJ_DATA ||
-	        slpmsg->flags == (P2P_WML2009_COMP | P2P_MSN_OBJ_DATA) ||
-	        slpmsg->flags == P2P_FILE_DATA) 
-		{
-			if (slpmsg->slpcall != NULL)
-			{
-				if (slpmsg->slpcall->cb)
-					slpmsg->slpcall->cb(slpmsg->slpcall,
-						NULL, 0);
-			}
-		}
-	}
-
-	msn_message_unref(msg);
-}
-
-/* We have received the message nak. */
-void
-msn_sbconn_msg_nak(MsnMessage *msg, void *data)
-{
-	MsnSlpMessage *slpmsg;
-
-	slpmsg = data;
-
-	msn_slplink_send_msgpart(slpmsg->slplink, slpmsg);
-
-	slpmsg->msgs = g_list_remove(slpmsg->msgs, msg);
-	msn_message_unref(msg);
-}
-#endif
-
-void msn_sbconn_send_msg(MsnSlpLink *slplink, MsnMessage *msg)
-{
-	if (slplink->swboard == NULL)
-	{
-		slplink->swboard = msn_session_get_swboard(slplink->session,
-				slplink->remote_user, MSN_SB_FLAG_FT);
-
-		g_return_if_fail(slplink->swboard != NULL);
-
-		/* If swboard is destroyed we will be too */
-		slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink);
-	}
-
-	msn_switchboard_send_msg(slplink->swboard, msg, TRUE);
-}
-
 void msn_sbconn_send_part(MsnSlpLink *slplink, MsnSlpMessagePart *part)
 {
 	MsnMessage *msg;
============================================================
--- libpurple/protocols/msn/sbconn.h	00058b70cb8c27a869f83c2a8e99aad33ab29d82
+++ libpurple/protocols/msn/sbconn.h	410133301b8ff7bbf81ee4712b44124900e0d027
@@ -6,11 +6,6 @@
 
 #define MSN_SBCONN_MAX_SIZE 1202
 
-void msn_sbconn_msg_ack(MsnMessage *msg, void *data);
-
-void msn_sbconn_msg_nak(MsnMessage *msg, void *data);
-
-void msn_sbconn_send_msg(MsnSlpLink *slplink, MsnMessage *msg);
 void msn_sbconn_send_part(MsnSlpLink *slplink, MsnSlpMessagePart *part);
 
 void msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg,
============================================================
--- libpurple/protocols/msn/slplink.c	b2e4fce6641d29ce86a42c77a73dee7b6e817b33
+++ libpurple/protocols/msn/slplink.c	c43a16178951d554a99aeba09eaac496e093c75b
@@ -278,20 +278,6 @@ msn_slplink_send_part(MsnSlpLink *slplin
 		msn_sbconn_send_part(slplink, part);
 	}
 }
-#if 0
-void
-msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg)
-{
-	if (slplink->dc != NULL && slplink->dc->state == DC_STATE_ESTABLISHED)
-	{
-		msn_dc_enqueue_msg(slplink->dc, msg);
-	}
-	else
-	{
-		msn_sbconn_send_msg(slplink, msg);
-	}
-}
-#endif
 
 void
 msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg)
@@ -403,19 +389,6 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
 	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);
-
-	msg->ack_cb = msn_sbconn_msg_ack;
-	msg->nak_cb = msn_sbconn_msg_nak;
-	msg->ack_data = slpmsg;
-
-	msn_slplink_send_msgpart(slplink, slpmsg);
-
-	msn_message_destroy(msg);
-#endif
 }
 
 void
============================================================
--- libpurple/protocols/msn/slplink.h	ce4dec96a931dde16578c5ac5a0148c8fbe020fc
+++ libpurple/protocols/msn/slplink.h	d25b835455385fc867cc09fadb3128b70b0da23d
@@ -84,7 +84,6 @@ void msn_slplink_request_ft(MsnSlpLink *
 void msn_slplink_process_msg(MsnSlpLink *slplink, MsnP2PHeader *header, const char *data, gsize len);
 void msn_slplink_request_ft(MsnSlpLink *slplink, PurpleXfer *xfer);
 
-void msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg);
 /* Only exported for msn_xfer_write */
 void msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg);
 
============================================================
--- libpurple/protocols/msn/slpmsg.c	a9715e582d77760a61297e37c6792c27dda0eec4
+++ libpurple/protocols/msn/slpmsg.c	71f315b663e01960aebb936bcb0e674f16ac780e
@@ -109,24 +109,6 @@ msn_slpmsg_destroy(MsnSlpMessage *slpmsg
 	if (slpmsg->img == NULL)
 		g_free(slpmsg->buffer);
 
-#if 0
-	for (cur = slpmsg->msgs; cur != NULL; cur = g_list_delete_link(cur, cur))
-	{
-		/* Something is pointing to this slpmsg, so we should remove that
-		 * pointer to prevent a crash. */
-		/* Ex: a user goes offline and after that we receive an ACK */
-
-		MsnMessage *msg = cur->data;
-
-		msg->ack_cb = NULL;
-		msg->nak_cb = NULL;
-		msg->ack_data = NULL;
-		msn_message_unref(msg);
-	}
-
-	slplink->slp_msgs = g_list_remove(slplink->slp_msgs, slpmsg);
-#endif
-
 	for (cur = slpmsg->parts; cur != NULL; cur = g_list_delete_link(cur, cur))
 	{
 		/* Something is pointing to this slpmsg, so we should remove that
@@ -191,37 +173,7 @@ msn_slpmsg_set_image(MsnSlpMessage *slpm
 	slpmsg->size = purple_imgstore_get_size(img);
 }
 
-#if 0
-void
-msn_slpmsg_show(MsnMessage *msg)
-{
-	const char *info;
-	gboolean text;
-	guint32 flags;
 
-	text = FALSE;
-
-	flags = GUINT32_TO_LE(msg->slpmsg->header->flags);
-
-	switch (flags)
-	{
-		case P2P_NO_FLAG :
-			info = "SLP CONTROL";
-			text = TRUE;
-			break;
-		case P2P_ACK:
-			info = "SLP ACK"; break;
-		case P2P_MSN_OBJ_DATA:
-		case P2P_FILE_DATA:
-			info = "SLP DATA"; break;
-		default:
-			info = "SLP UNKNOWN"; break;
-	}
-
-	msn_message_show_readable(msg, info, text);
-}
-#endif
-
 MsnSlpMessage *
 msn_slpmsg_sip_new(MsnSlpCall *slpcall, int cseq,
 				   const char *header, const char *branch,
============================================================
--- libpurple/protocols/msn/slpmsg.h	8a2aa89a6093d245bac337a1318953161b6f05ee
+++ libpurple/protocols/msn/slpmsg.h	d548f040bf4d972f284ad299c7b360bd5effa338
@@ -76,11 +76,6 @@ struct _MsnSlpMessage
 
 	GList *parts; /**< A list with the SlpMsgParts */
 
-#if 0
-	GList *msgs; /**< The real messages. */
-	MsnMessage *msg; /**< The temporary real message that will be sent. */
-#endif
-
 	const char *info;
 	gboolean text_body;
 };
@@ -167,10 +162,6 @@ MsnSlpMessage *msn_slpmsg_file_new(MsnSl
  */
 MsnSlpMessage *msn_slpmsg_file_new(MsnSlpCall *slpcall, size_t size);
 
-#if 0
-void msn_slpmsg_show(MsnMessage *msg);
-#endif
-
 /**
  * Serialize the MsnSlpMessage in a way it can be used to be transmited
  *


More information about the Commits mailing list