soc.2010.msn-tlc: 2baa1459: Since we can create a SlpMessage without...

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


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

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

ChangeLog: 

Since we can create a SlpMessage without a SlpLink, add a function to relate them post-creation.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slpmsg.c	6ed98a51527fcf876f12fe498a861621f8456dd2
+++ libpurple/protocols/msn/slpmsg.c	819cddc93574f5ae00cec89d1dd92d832155d302
@@ -42,12 +42,9 @@ msn_slpmsg_new(MsnSlpLink *slplink)
 	if (purple_debug_is_verbose())
 		purple_debug_info("msn", "slpmsg new (%p)\n", slpmsg);
 
-	if (slplink) {
-		slpmsg->slplink = slplink;
-
-		slplink->slp_msgs =
-			g_list_append(slplink->slp_msgs, slpmsg);
-	} else
+	if (slplink) 
+		msn_slpmsg_set_slplink(slpmsg, slplink);
+	else
 		slpmsg->slplink = NULL;
 
 	slpmsg->header = NULL;
@@ -134,6 +131,18 @@ void
 }
 
 void
+msn_slpmsg_set_slplink(MsnSlpMessage *slpmsg, MsnSlpLink *slplink)
+{
+	g_return_if_fail(slplink != NULL);
+
+	slpmsg->slplink = slplink;
+
+	slplink->slp_msgs =
+		g_list_append(slplink->slp_msgs, slpmsg);
+
+}
+
+void
 msn_slpmsg_set_body(MsnSlpMessage *slpmsg, const char *body,
 						 long long size)
 {
============================================================
--- libpurple/protocols/msn/slpmsg.h	ec8bf59de5566a02b2db027e84ec266f18f3d682
+++ libpurple/protocols/msn/slpmsg.h	be8ee8c2a6e8b72e0a37146d293845eba4e3c4e9
@@ -111,6 +111,13 @@ void msn_slpmsg_destroy(MsnSlpMessage *s
  */
 void msn_slpmsg_destroy(MsnSlpMessage *slpmsg);
 
+/**
+ * Relate this SlpMessage with an existing SlpLink
+ *
+ * @param slplink 	The SlpLink that will send this message.
+ */
+void msn_slpmsg_set_slplink(MsnSlpMessage *slpmsg, MsnSlpLink *slplink);
+
 void msn_slpmsg_set_body(MsnSlpMessage *slpmsg, const char *body,
 						 long long size);
 void msn_slpmsg_set_image(MsnSlpMessage *slpmsg, PurpleStoredImage *img);


More information about the Commits mailing list