diff libpurple/protocols/msn/msn.c @ 28417:ea7e54c4d7fd

Check for empty messages before sending them in chats. This is the same send-only-HR's problem that affected IM's. References #8057.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 23 Aug 2009 01:03:07 +0000
parents e7a2e2208f88
children afe6ce7cc64f
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Sat Aug 22 23:58:18 2009 +0000
+++ b/libpurple/protocols/msn/msn.c	Sun Aug 23 01:03:07 2009 +0000
@@ -1722,6 +1722,7 @@
 	MsnMessage *msg;
 	char *msgformat;
 	char *msgtext;
+	size_t msglen;
 
 	account = purple_connection_get_account(gc);
 	session = gc->proto_data;
@@ -1736,8 +1737,9 @@
 	swboard->flag |= MSN_SB_FLAG_IM;
 
 	msn_import_html(message, &msgformat, &msgtext);
-
-	if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
+	msglen = strlen(msgtext);
+
+	if ((msglen == 0) || (msglen + strlen(msgformat) + strlen(VERSION) > 1564))
 	{
 		g_free(msgformat);
 		g_free(msgtext);