diff libgaim/protocols/msn/slp.c @ 20390:d634f88e25d8

msn.tgz from SF Patch #1621854 from Ka-Hing Cheung "This tarball brings soc-2006-msnp13 up to head. In addition to that it also fixes a crash with sending offline messages. I wasn't able to generate a diff against that branch, svn seems to insist on diff'ing against HEAD after I run the merge command. After running `svn merge -r 16309:HEAD https://gaim.svn.sourceforge.net/svnroot/gaim/trunk` on the soc-2006-msnp13 you can replace the msn directory with the attached tarball. The fix for offline messaging is on msn.c:901: if (!session->oim) session->oim = msn_oim_new(session)" committer: Richard Laager <rlaager@wiktel.com>
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 15 Apr 2007 02:18:17 +0000
parents e354528c4163
children 9ba7dee775e1
line wrap: on
line diff
--- a/libgaim/protocols/msn/slp.c	Sun Apr 15 02:10:37 2007 +0000
+++ b/libgaim/protocols/msn/slp.c	Sun Apr 15 02:18:17 2007 +0000
@@ -341,33 +341,31 @@
 
 		xfer = gaim_xfer_new(account, GAIM_XFER_RECEIVE,
 							 slpcall->slplink->remote_user);
-		if (xfer)
-		{
-			bin = (char *)gaim_base64_decode(context, &bin_len);
-			file_size = GUINT32_FROM_LE(*((gsize *)bin + 2));
+
+		bin = (char *)gaim_base64_decode(context, &bin_len);
+		file_size = GUINT32_FROM_LE(*((gsize *)bin + 2));
 
-			uni_name = (gunichar2 *)(bin + 20);
-			while(*uni_name != 0 && ((char *)uni_name - (bin + 20)) < MAX_FILE_NAME_LEN) {
-				*uni_name = GUINT16_FROM_LE(*uni_name);
-				uni_name++;
-			}
+		uni_name = (gunichar2 *)(bin + 20);
+		while(*uni_name != 0 && ((char *)uni_name - (bin + 20)) < MAX_FILE_NAME_LEN) {
+			*uni_name = GUINT16_FROM_LE(*uni_name);
+			uni_name++;
+		}
 
-			file_name = g_utf16_to_utf8((const gunichar2 *)(bin + 20), -1,
-										NULL, NULL, NULL);
+		file_name = g_utf16_to_utf8((const gunichar2 *)(bin + 20), -1,
+									NULL, NULL, NULL);
 
-			g_free(bin);
+		g_free(bin);
 
-			gaim_xfer_set_filename(xfer, file_name);
-			gaim_xfer_set_size(xfer, file_size);
-			gaim_xfer_set_init_fnc(xfer, msn_xfer_init);
-			gaim_xfer_set_request_denied_fnc(xfer, msn_xfer_cancel);
-			gaim_xfer_set_cancel_recv_fnc(xfer, msn_xfer_cancel);
+		gaim_xfer_set_filename(xfer, file_name);
+		gaim_xfer_set_size(xfer, file_size);
+		gaim_xfer_set_init_fnc(xfer, msn_xfer_init);
+		gaim_xfer_set_request_denied_fnc(xfer, msn_xfer_cancel);
+		gaim_xfer_set_cancel_recv_fnc(xfer, msn_xfer_cancel);
 
-			slpcall->xfer = xfer;
-			xfer->data = slpcall;
+		slpcall->xfer = xfer;
+		xfer->data = slpcall;
 
-			gaim_xfer_request(xfer);
-		}
+		gaim_xfer_request(xfer);
 	}
 }
 
@@ -753,7 +751,7 @@
 		 * reporting bugs. Hopefully this doesn't cause more crashes. Stu.
 		 */
 		if (slplink->swboard != NULL)
-			slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink);
+			slplink->swboard->slplink = slplink;
 		else
 			gaim_debug_error("msn", "msn_p2p_msg, swboard is NULL, ouch!\n");
 	}
@@ -773,15 +771,14 @@
 	gc = slpcall->slplink->session->account->gc;
 	who = slpcall->slplink->remote_user;
 
-	if ((conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, who, gc->account))) {
+	conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, who, gc->account);
 
-		/* FIXME: it would be better if we wrote the data as we received it
-		          instead of all at once, calling write multiple times and
-		          close once at the very end
-		*/
-		gaim_conv_custom_smiley_write(conv, slpcall->data_info, data, size);
-		gaim_conv_custom_smiley_close(conv, slpcall->data_info);
-	}
+	/* FIXME: it would be better if we wrote the data as we received it
+	          instead of all at once, calling write multiple times and
+	          close once at the very end
+	*/
+	gaim_conv_custom_smiley_write(conv, slpcall->data_info, data, size);
+	gaim_conv_custom_smiley_close(conv, slpcall->data_info );
 #ifdef MSN_DEBUG_UD
 	gaim_debug_info("msn", "Got smiley: %s\n", slpcall->data_info);
 #endif