diff libpurple/protocols/msn/switchboard.c @ 30013:119bd7b072eb

Initial support for direct connections. Preliminary patch from ticket #247 by Gbor Szuromi. Still needs lots of testing and fixes. References #247. committer: Elliott Sales de Andrade <qulogic@pidgin.im>
author kukkerman@gmail.com
date Wed, 17 Mar 2010 03:45:07 +0000
parents 19be6fe515ca
children 911ca152210c
line wrap: on
line diff
--- a/libpurple/protocols/msn/switchboard.c	Tue Mar 16 06:20:05 2010 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Wed Mar 17 03:45:07 2010 +0000
@@ -87,8 +87,17 @@
 		purple_timeout_remove(swboard->reconn_timeout_h);
 
 	/* If it linked us is because its looking for trouble */
-	while (swboard->slplinks != NULL)
-		msn_slplink_destroy(swboard->slplinks->data);
+	while (swboard->slplinks != NULL) {
+		/* Destroy only those slplinks which use the switchboard */
+		MsnSlpLink	*slplink = swboard->slplinks->data;
+
+		if (slplink->dc == NULL)
+			msn_slplink_destroy(slplink);
+		else {
+			swboard->slplinks = g_list_remove(swboard->slplinks, slplink);
+			slplink->swboard = NULL;
+		}
+	}
 
 	/* Destroy the message queue */
 	while ((msg = g_queue_pop_head(swboard->msg_queue)) != NULL)