diff src/protocols/msn/slplink.c @ 10602:f52ab405f1ab

[gaim-migrate @ 12032] This is patch 1112281 from Felipe Contreras, it prevents file transfers being cancelled when closing a conversation window with the sender/recipient. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 16 Feb 2005 20:14:12 +0000
parents 0f7452b1f777
children fe919915fceb
line wrap: on
line diff
--- a/src/protocols/msn/slplink.c	Wed Feb 16 03:57:23 2005 +0000
+++ b/src/protocols/msn/slplink.c	Wed Feb 16 20:14:12 2005 +0000
@@ -54,6 +54,10 @@
 }
 #endif
 
+/**************************************************************************
+ * Main
+ **************************************************************************/
+
 MsnSlpLink *
 msn_slplink_new(MsnSession *session, const char *username)
 {
@@ -155,6 +159,31 @@
 	return NULL;
 }
 
+void
+msn_slplink_add_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall)
+{
+	if (slplink->slp_calls == NULL)
+	{
+		if (slplink->swboard != NULL)
+			slplink->swboard->flag |= MSN_SB_FLAG_FT;
+	}
+
+	slplink->slp_calls = g_list_append(slplink->slp_calls, slpcall);
+}
+
+void
+msn_slplink_remove_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall)
+{
+	slplink->slp_calls = g_list_remove(slplink->slp_calls, slpcall);
+
+	/* The slplink has no slpcalls in it, maybe we should destroy it. */
+	if (slplink->slp_calls == NULL)
+	{
+		if (slplink->swboard != NULL)
+			slplink->swboard->flag &= ~MSN_SB_FLAG_FT;
+	}
+}
+
 MsnSlpCall *
 msn_slplink_find_slp_call(MsnSlpLink *slplink, const char *id)
 {
@@ -204,7 +233,8 @@
 		if (slplink->swboard == NULL)
 		{
 			slplink->swboard = msn_session_get_swboard(slplink->session,
-													   slplink->remote_user);
+													   slplink->remote_user,
+													   MSN_SB_FLAG_FT);
 
 			if (slplink->swboard == NULL)
 				return;