diff src/protocols/msn/msn.c @ 10274:3016b1b32339

[gaim-migrate @ 11424] Don't allow sending oversized messages on MSN - they wouldn't get there, and the switchboard server would disconnect us. Also fix up the oversized message truncation which should have been truncating the messages anyway. Add support for sending strikethrough on MSN (not that anyone can actually enter strikethrough tags yet) And a slight change to the building of chat user status icons. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 27 Nov 2004 19:39:25 +0000
parents ecf3ce2e2ab1
children d9468bd22b7c
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Sat Nov 27 17:10:36 2004 +0000
+++ b/src/protocols/msn/msn.c	Sat Nov 27 19:39:25 2004 +0000
@@ -735,6 +735,15 @@
 		swboard = msn_session_get_swboard(session, who);
 
 		msn_import_html(message, &msgformat, &msgtext);
+
+		if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
+		{
+			g_free(msgformat);
+			g_free(msgtext);
+
+			return -E2BIG;
+		}
+
 		msg = msn_message_new_plain(msgtext);
 		msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat);
 
@@ -1130,6 +1139,14 @@
 	{
 		msn_import_html(message, &msgformat, &msgtext);
 
+		if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
+		{
+			g_free(msgformat);
+			g_free(msgtext);
+
+			return -E2BIG;
+		}
+
 		msg = msn_message_new_plain(msgtext);
 		msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat);
 		msn_switchboard_send_msg(swboard, msg);