changeset 31266:471e9b81da41

Remove all unneeded MsnMessage related code that was replaced by SlpParts.
author masca@cpw.pidgin.im
date Wed, 23 Jun 2010 22:47:49 +0000
parents 4e0593a35b8c
children 85f66a8f2633
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
diffstat 6 files changed, 0 insertions(+), 167 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/sbconn.c	Tue Jun 22 23:23:15 2010 +0000
+++ b/libpurple/protocols/msn/sbconn.c	Wed Jun 23 22:47:49 2010 +0000
@@ -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;
--- a/libpurple/protocols/msn/sbconn.h	Tue Jun 22 23:23:15 2010 +0000
+++ b/libpurple/protocols/msn/sbconn.h	Wed Jun 23 22:47:49 2010 +0000
@@ -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,
--- a/libpurple/protocols/msn/slplink.c	Tue Jun 22 23:23:15 2010 +0000
+++ b/libpurple/protocols/msn/slplink.c	Wed Jun 23 22:47:49 2010 +0000
@@ -278,20 +278,6 @@
 		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 @@
 	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
--- a/libpurple/protocols/msn/slplink.h	Tue Jun 22 23:23:15 2010 +0000
+++ b/libpurple/protocols/msn/slplink.h	Wed Jun 23 22:47:49 2010 +0000
@@ -84,7 +84,6 @@
 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);
 
--- a/libpurple/protocols/msn/slpmsg.c	Tue Jun 22 23:23:15 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg.c	Wed Jun 23 22:47:49 2010 +0000
@@ -109,24 +109,6 @@
 	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,36 +173,6 @@
 	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,
--- a/libpurple/protocols/msn/slpmsg.h	Tue Jun 22 23:23:15 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg.h	Wed Jun 23 22:47:49 2010 +0000
@@ -76,11 +76,6 @@
 
 	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(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
  *