soc.2010.msn-tlc: a222d47d: Add a function that enqueue a Part inste...

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


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

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

ChangeLog: 

Add a function that enqueue a Part instead of a Message since directconn does not sends messages.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c	2ba2caccaa232c569aee2a7a80c6010821004953
+++ libpurple/protocols/msn/directconn.c	5f23e41e40e01a3ae2e44ccfd08ba1165b8f13a8
@@ -557,6 +557,23 @@ msn_dc_enqueue_msg(MsnDirectConn *dc, Ms
 	msn_dc_enqueue_packet(dc, p);
 }
 
+void
+msn_dc_enqueue_part(MsnDirectConn *dc, MsnSlpMessagePart *part)
+{
+	MsnDirectConnPacket *p;
+	guint32 length;
+
+	length = part->size + P2P_PACKET_HEADER_SIZE;
+	p = msn_dc_new_packet(length);
+
+	memcpy(p->data, part->header, P2P_PACKET_HEADER_SIZE);
+	memcpy(p->data + P2P_PACKET_HEADER_SIZE, part->buffer, part->size);
+
+	p->sent_cb = msn_dc_send_packet_cb;
+
+	msn_dc_enqueue_packet(dc, p);
+}
+
 static int
 msn_dc_process_packet(MsnDirectConn *dc, guint32 packet_length)
 {
============================================================
--- libpurple/protocols/msn/directconn.h	45f0333bb464cc48e28a5e62ae625a6796d5d06a
+++ libpurple/protocols/msn/directconn.h	17da80547ba777b2b104986e3751365a068efe96
@@ -34,6 +34,7 @@ typedef struct _MsnDirectConn MsnDirectC
 #include "slp.h"
 #include "slplink.h"
 #include "slpmsg.h"
+#include "slpmsg_part.h"
 #include "p2p.h"
 
 #define MSN_DCCONN_MAX_SIZE 1352
@@ -129,6 +130,8 @@ msn_dc_enqueue_msg(MsnDirectConn *dc, Ms
  */
 void
 msn_dc_enqueue_msg(MsnDirectConn *dc, MsnMessage *msg);
+void
+msn_dc_enqueue_part(MsnDirectConn *dc, MsnSlpMessagePart *part);
 
 /*
  * Creates, initializes, and returns a new MsnDirectConn structure.


More information about the Commits mailing list