soc.2010.msn-tlc: c3f5c6f7: Add support in SBConn to send parts inst...

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


-----------------------------------------------------------------
Revision: c3f5c6f78e3b02b7d9cf5aa2c09873dff549912f
Ancestor: a222d47d0bed2d96c6c0c590c6f1f03831749b4d
Author: masca at cpw.pidgin.im
Date: 2010-06-16T21:45:50
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/c3f5c6f78e3b02b7d9cf5aa2c09873dff549912f

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

ChangeLog: 

Add support in SBConn to send parts instead of messages.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/sbconn.c	41f3ea6b941d6dd4eaf8a80671d3e3c6053cbeab
+++ libpurple/protocols/msn/sbconn.c	5484cf31f72d32cf9f76fb0b9fca160bd6947ded
@@ -1,3 +1,6 @@
+#include "internal.h"
+
+#include "msg.h"
 #include "sbconn.h"
 
 /* We have received the message ack */
@@ -74,3 +77,30 @@ void msn_sbconn_send_msg(MsnSlpLink *slp
 
 	msn_switchboard_send_msg(slplink->swboard, msg, TRUE);
 }
+
+void msn_sbconn_send_part(MsnSlpLink *slplink, MsnSlpMessagePart *part)
+{
+	MsnMessage *msg;
+	char *data;
+	size_t size;
+
+	msg = msn_message_new_msnslp();
+
+	data = msn_slpmsgpart_serialize(part, &size);
+	msg->part = part;
+
+	msn_message_set_bin_data(msg, data, size);
+
+	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);
+}
============================================================
--- libpurple/protocols/msn/sbconn.h	4095835a2d125f29ce57b3c7d25d14d5f3926ded
+++ libpurple/protocols/msn/sbconn.h	22693c5892efab5ba357a9c19f0e91c49b435b56
@@ -11,5 +11,6 @@ void msn_sbconn_send_msg(MsnSlpLink *slp
 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);
 
 #endif /* MSN_SBCONN_H */


More information about the Commits mailing list