changeset 28956:36dff94b1b53

merge of '557198948608028bc4f826a546a3948c4899bdf0' and 'f34a9d45f9fd63b92e95fe69115042eadbe7c053'
author Mark Doliner <mark@kingant.net>
date Wed, 03 Feb 2010 22:02:46 +0000
parents 57550ffb7870 (diff) 8724fcca91ba (current diff)
children 452043d200f0
files
diffstat 2 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Feb 03 21:24:55 2010 +0000
+++ b/ChangeLog	Wed Feb 03 22:02:46 2010 +0000
@@ -38,8 +38,8 @@
 	* Don't do an SRV lookup for a STUN server associated with the account
 	  if one is already set globally in prefs.
 	* Don't send custom smileys larger than the recommended maximum object size
-	  specified in the BoB XEP. Will prevent getting disconnected because of
-	  sending to large stanzas.
+	  specified in the BoB XEP.   This prevents a client from being
+	  disconnected by servers that dislike overly-large stanzas.
 
 	Yahoo:
 	* Don't send <span> and </span> tags.  (Fartash Faghri)
--- a/libpurple/protocols/jabber/message.c	Wed Feb 03 21:24:55 2010 +0000
+++ b/libpurple/protocols/jabber/message.c	Wed Feb 03 22:02:46 2010 +0000
@@ -985,6 +985,7 @@
 			gchar *smileyfied_xhtml = NULL;
 			const GList *iterator;
 			GList *valid_smileys = NULL;
+			gboolean has_too_large_smiley = FALSE;
 			
 			for (iterator = found_smileys; iterator ;
 				iterator = g_list_next(iterator)) {
@@ -1011,15 +1012,20 @@
 					}
 					valid_smileys = g_list_append(valid_smileys, smiley);
 				} else {
-					gchar *msg =
-						g_strdup_printf(_("Custom smiley with shortcut %s is too large to send."),
-						    purple_smiley_get_shortcut(smiley));
-					purple_conversation_write(conv, NULL, msg,
-					    PURPLE_MESSAGE_ERROR, time(NULL));
-					g_free(msg);
+					has_too_large_smiley = TRUE;
+					purple_debug_warning("jabber", "Refusing to send smiley %s "
+							"(too large, max is %d)\n",
+							purple_smiley_get_shortcut(smiley),
+							JABBER_DATA_MAX_SIZE);
 				}				
 			}
 
+			if (has_too_large_smiley) {
+				purple_conversation_write(conv, NULL,
+				    _("A custom smiley in the message is too large to send."),
+					PURPLE_MESSAGE_ERROR, time(NULL));
+			}
+
 			smileyfied_xhtml =
 				jabber_message_get_smileyfied_xhtml(xhtml, valid_smileys);
 			g_list_free(found_smileys);