diff libpurple/protocols/msn/slpcall.c @ 29073:59b0c556f787

A quick and dirty hack to make MSN use the in-core code to perform FT. This has the advantage of not requiring an on-disk file or socket that the MSN code steals from the core. That said, this is pretty bad code which I'm only checking in as-is so that I can go back to using trunk without it.
author Paul Aurich <paul@darkrain42.org>
date Fri, 16 Oct 2009 01:26:04 +0000
parents 500d1e806264
children 69077f3993f6
line wrap: on
line diff
--- a/libpurple/protocols/msn/slpcall.c	Fri Oct 16 01:16:38 2009 +0000
+++ b/libpurple/protocols/msn/slpcall.c	Fri Oct 16 01:26:04 2009 +0000
@@ -105,10 +105,13 @@
 		slpcall->end_cb(slpcall, slpcall->slplink->session);
 
 	if (slpcall->xfer != NULL) {
+		if (purple_xfer_get_type(slpcall->xfer) == PURPLE_XFER_RECEIVE)
+			g_byte_array_free(slpcall->u.incoming_data, TRUE);
 		slpcall->xfer->data = NULL;
 		purple_xfer_unref(slpcall->xfer);
 	}
 
+
 	msn_slplink_remove_slpcall(slpcall->slplink, slpcall);
 
 	g_free(slpcall->id);
@@ -272,7 +275,8 @@
 				slpcall->timer = 0;
 			}
 
-			slpcall->cb(slpcall, body, body_len);
+			if (slpcall->cb)
+				slpcall->cb(slpcall, body, body_len);
 
 			slpcall->wasted = TRUE;
 		}