changeset 9828:e8334906b2fb

[gaim-migrate @ 10699] This stops you from sending a message that's too large on Yahoo! Thanks to Joe Shaw for pointing out a 2000 byte limit, which I haven't bothered to double check myself yet. He provided his own patch, but I did this instead, because he was dropping all packets over 2000 bytes, and I'm not completely sure that's needed yet, and this way is less likely to break something. Hmm I wonder how large conferences work. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 22 Aug 2004 18:50:33 +0000
parents 430ef8fc963d
children e98c9a80fb74
files src/protocols/yahoo/yahoo.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Sun Aug 22 18:24:33 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sun Aug 22 18:50:33 2004 +0000
@@ -2836,6 +2836,7 @@
 	char *msg = yahoo_html_to_codes(what);
 	char *msg2;
 	gboolean utf8 = TRUE;
+	int ret = 1;
 
 	msg2 = yahoo_string_encode(gc, msg, &utf8);
 
@@ -2853,14 +2854,18 @@
 	else
 		yahoo_packet_hash(pkt, 206, "2");
 
-	yahoo_send_packet(yd, pkt);
+	/* We may need to not send any packets over 2000 bytes, but I'm not sure yet. */
+	if ((YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt)) <= 2000)
+		yahoo_send_packet(yd, pkt);
+	else
+		ret = -E2BIG;
 
 	yahoo_packet_free(pkt);
 
 	g_free(msg);
 	g_free(msg2);
 
-	return 1;
+	return ret;
 }
 
 int yahoo_send_typing(GaimConnection *gc, const char *who, int typ)