Mercurial > pidgin
diff libpurple/protocols/msn/directconn.c @ 30797:efe9b0338606
Add a function that enqueue a Part instead of a Message since directconn does not sends messages.
author | masca@cpw.pidgin.im |
---|---|
date | Wed, 16 Jun 2010 21:32:12 +0000 |
parents | 320c0852b5cc |
children | 0678ad30aa65 |
line wrap: on
line diff
--- a/libpurple/protocols/msn/directconn.c Wed Jun 16 21:25:11 2010 +0000 +++ b/libpurple/protocols/msn/directconn.c Wed Jun 16 21:32:12 2010 +0000 @@ -557,6 +557,23 @@ 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) {