diff libpurple/protocols/yahoo/yahoo.h @ 24343:9e0458c98b4c

This was originally a patch from Brian Geppert that corrected the 'silently truncates messages at 800 characters' bug in yahoo. I changed the patch to reflect the reality I saw, which is that the maximum message length is 946 bytes, but only 800 characters. It's possible to fall between 800 and 946 bytes but not exceed 800 characters by using multibyte characters.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Thu, 13 Nov 2008 08:39:44 +0000
parents b5210bb72273
children 9656dbf35fb0 0a19fa42f8ce 6ecfc6b9667c
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.h	Thu Nov 13 08:26:12 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.h	Thu Nov 13 08:39:44 2008 +0000
@@ -182,6 +182,21 @@
 
 #define YAHOO_MAX_STATUS_MESSAGE_LENGTH (255)
 
+/*
+ * Current Maximum Length for Instant Messages
+ *
+ * This was found by experiment.
+ *
+ * The YMSG protocol allows a message of up to 948 bytes, but the official client
+ * limits to 800 characters.  According to experiments I conducted, it seems that
+ * the discrepancy is to allow some leeway for messages with mixed single- and
+ * multi-byte characters, as I was able to send messages of 840 and 932 bytes
+ * by using some multibyte characters (some random Chinese or Japanese characters,
+ * to be precise). - rekkanoryo
+ */
+#define YAHOO_MAX_MESSAGE_LENGTH_BYTES 948
+#define YAHOO_MAX_MESSAGE_LENGTH_CHARS 800
+
 /* sometimes i wish prpls could #include things from other prpls. then i could just
  * use the routines from libfaim and not have to admit to knowing how they work. */
 #define yahoo_put16(buf, data) ( \