pidgin: fd7fe631: Check for empty messages before sending ...

qulogic at pidgin.im qulogic at pidgin.im
Sat Aug 22 23:35:42 EDT 2009


-----------------------------------------------------------------
Revision: fd7fe6317b7006143473cb438061b45983e896d6
Ancestor: 25b9e69aec765b3584793478594d7adbd658871f
Author: qulogic at pidgin.im
Date: 2009-08-23T01:03:07
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/fd7fe6317b7006143473cb438061b45983e896d6

Modified files:
        libpurple/protocols/msn/msn.c

ChangeLog: 

Check for empty messages before sending them in chats. This is the same
send-only-HR's problem that affected IM's.

References #8057.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	160c0a0bdb2566d8b2b2620ce4832a5e2731b8c2
+++ libpurple/protocols/msn/msn.c	433afd6e5a563a823dc61e85deeec91cd89f27bd
@@ -1722,6 +1722,7 @@ msn_chat_send(PurpleConnection *gc, int 
 	MsnMessage *msg;
 	char *msgformat;
 	char *msgtext;
+	size_t msglen;
 
 	account = purple_connection_get_account(gc);
 	session = gc->proto_data;
@@ -1736,8 +1737,9 @@ msn_chat_send(PurpleConnection *gc, int 
 	swboard->flag |= MSN_SB_FLAG_IM;
 
 	msn_import_html(message, &msgformat, &msgtext);
+	msglen = strlen(msgtext);
 
-	if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
+	if ((msglen == 0) || (msglen + strlen(msgformat) + strlen(VERSION) > 1564))
 	{
 		g_free(msgformat);
 		g_free(msgtext);


More information about the Commits mailing list