changeset 31219:74e372b31486

Allow temporary SlpMessages so we can get slp specific code from MsnMessage.
author masca@cpw.pidgin.im
date Tue, 08 Jun 2010 01:45:49 +0000
parents b98d1ca8422d
children 3ccddae82532
files libpurple/protocols/msn/slpmsg.c libpurple/protocols/msn/slpmsg.h
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slpmsg.c	Tue Jun 08 01:40:39 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg.c	Tue Jun 08 01:45:49 2010 +0000
@@ -42,10 +42,13 @@
 	if (purple_debug_is_verbose())
 		purple_debug_info("msn", "slpmsg new (%p)\n", slpmsg);
 
-	slpmsg->slplink = slplink;
+	if (slplink) {
+		slpmsg->slplink = slplink;
 
-	slplink->slp_msgs =
-		g_list_append(slplink->slp_msgs, slpmsg);
+		slplink->slp_msgs =
+			g_list_append(slplink->slp_msgs, slpmsg);
+	} else
+		slpmsg->slplink = NULL;
 
 	slpmsg->header = NULL;
 	slpmsg->footer = NULL;
--- a/libpurple/protocols/msn/slpmsg.h	Tue Jun 08 01:40:39 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg.h	Tue Jun 08 01:45:49 2010 +0000
@@ -88,6 +88,7 @@
  * Creates a new slp message
  *
  * @param slplink The slplink through which this slp message will be sent.
+ * If it's set to NULL, it is a temporary SlpMessage.
  * @return The created slp message.
  */
 MsnSlpMessage *msn_slpmsg_new(MsnSlpLink *slplink);