changeset 29343:bf0db10b0e3c

jabber: Don't print the smiley shortcut in the error message when trying to send a too large custom smiley, since the shortcut get substituded in the error message, and I'm not sure we want that...
author Marcus Lundblad <ml@update.uu.se>
date Wed, 03 Feb 2010 21:34:41 +0000
parents 8271e42acdcb
children 68cd5a8a3ffe 0629b6814963
files libpurple/protocols/jabber/message.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/message.c	Wed Feb 03 21:11:25 2010 +0000
+++ b/libpurple/protocols/jabber/message.c	Wed Feb 03 21:34:41 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,16 @@
 					}
 					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;
 				}				
 			}
 
+			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);