diff libpurple/protocols/msn/slp.c @ 24382:809de3ab85d1

If we're setting swboard here then we need to add the slplink to the linked list
author Mark Doliner <mark@kingant.net>
date Sat, 15 Nov 2008 01:51:04 +0000
parents b44e1bbd5b4a
children 3609fb4bc78e
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Fri Nov 14 22:14:19 2008 +0000
+++ b/libpurple/protocols/msn/slp.c	Sat Nov 15 01:51:04 2008 +0000
@@ -758,17 +758,17 @@
 
 	if (slplink->swboard == NULL)
 	{
+		/*
+		 * We will need swboard in order to change its flags.  If its
+		 * NULL, something has probably gone wrong earlier on.  I
+		 * didn't want to do this, but MSN 7 is somehow causing us
+		 * to crash here, I couldn't reproduce it to debug more,
+		 * and people are reporting bugs. Hopefully this doesn't
+		 * cause more crashes. Stu.
+		 */
 		if (cmdproc->data == NULL)
 			g_warning("msn_p2p_msg cmdproc->data was NULL\n");
 		else {
-			/*
-			 * We will swboard in order to change its flags.  If its
-			 * NULL, something has probably gone wrong earlier on.  I
-			 * didn't want to do this, but MSN 7 is somehow causing us
-			 * to crash here, I couldn't reproduce it to debug more,
-			 * and people are reporting bugs. Hopefully this doesn't
-			 * cause more crashes. Stu.
-			 */
 			slplink->swboard = (MsnSwitchBoard *)cmdproc->data;
 			slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink);
 		}
@@ -857,6 +857,7 @@
 				 */
 				slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink);
 			slplink->swboard = swboard;
+			slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink);
 		}
 
 		/* If the conversation doesn't exist then this is a custom smiley