soc.2010.msn-tlc: 2f970e54: The creation of SlpMessage must be done ...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Fri Jun 11 12:52:11 EDT 2010


-----------------------------------------------------------------
Revision: 2f970e541e55b8bed161082b2fff07f59f12fae4
Ancestor: 2baa1459f60e0d607e1c3c740aea075ce4d15a51
Author: masca at cpw.pidgin.im
Date: 2010-06-10T22:40:44
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/2f970e541e55b8bed161082b2fff07f59f12fae4

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

ChangeLog: 

The creation of SlpMessage must be done in its own module.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c	b0caf7d5dca0655ea59d394ca4beeb722ff093e6
+++ libpurple/protocols/msn/slplink.c	d2bb985a259189ec94fd206c584e9cb96fb90e86
@@ -505,16 +505,9 @@ msn_slplink_create_ack(MsnSlpLink *slpli
 {
 	MsnSlpMessage *slpmsg;
 
-	slpmsg = msn_slpmsg_new(slplink);
+	slpmsg = msn_slpmsg_new_ack(header);
+	msn_slpmsg_set_slplink(slpmsg, slplink);
 
-	slpmsg->session_id = header->session_id;
-	slpmsg->size       = header->total_size;
-	slpmsg->flags      = P2P_ACK;
-	slpmsg->ack_id     = header->id;
-	slpmsg->ack_sub_id = header->ack_id;
-	slpmsg->ack_size   = header->total_size;
-	slpmsg->info = "SLP ACK";
-
 	return slpmsg;
 }
 
============================================================
--- libpurple/protocols/msn/slpmsg.c	819cddc93574f5ae00cec89d1dd92d832155d302
+++ libpurple/protocols/msn/slpmsg.c	d1957d9f3598d5c6a9cbd2c32390923005466b56
@@ -263,6 +263,23 @@ msn_slpmsg_sip_new(MsnSlpCall *slpcall, 
 	return slpmsg;
 }
 
+MsnSlpMessage *msn_slpmsg_new_ack(MsnP2PHeader *header)
+{
+	MsnSlpMessage *slpmsg;
+
+	slpmsg = msn_slpmsg_new(NULL);
+
+	slpmsg->session_id = header->session_id;
+	slpmsg->size       = header->total_size;
+	slpmsg->flags      = P2P_ACK;
+	slpmsg->ack_id     = header->id;
+	slpmsg->ack_sub_id = header->ack_id;
+	slpmsg->ack_size   = header->total_size;
+	slpmsg->info = "SLP ACK";
+
+	return slpmsg;
+}
+
 char *msn_slpmsg_serialize(MsnSlpMessage *slpmsg, size_t *ret_size)
 {
 	MsnP2PHeader *header;
============================================================
--- libpurple/protocols/msn/slpmsg.h	be8ee8c2a6e8b72e0a37146d293845eba4e3c4e9
+++ libpurple/protocols/msn/slpmsg.h	7926313e7301651878b108b0360050dd631e3795
@@ -129,6 +129,15 @@ MsnSlpMessage * msn_slpmsg_sip_new(MsnSl
 								   const char *content_type,
 								   const char *content);
 
+/**
+ * Create a new SLP Ack message
+ *
+ * @param header the value of the header in this slpmsg.
+ *
+ * @return A new SlpMessage with ACK headers
+ */
+MsnSlpMessage *msn_slpmsg_new_ack(MsnP2PHeader *header);
+
 void msn_slpmsg_show(MsnMessage *msg);
 
 /**


More information about the Commits mailing list