libpurple/protocols/jabber/message.c

changeset 29270
642d7a9e5f0a
parent 29269
8145c8ab4935
child 29277
ff5a56fae229
equal deleted inserted replaced
29269:8145c8ab4935 29270:642d7a9e5f0a
983 983
984 if (found_smileys) { 984 if (found_smileys) {
985 gchar *smileyfied_xhtml = NULL; 985 gchar *smileyfied_xhtml = NULL;
986 const GList *iterator; 986 const GList *iterator;
987 GList *valid_smileys = NULL; 987 GList *valid_smileys = NULL;
988 gboolean has_too_large_smiley = FALSE;
988 989
989 for (iterator = found_smileys; iterator ; 990 for (iterator = found_smileys; iterator ;
990 iterator = g_list_next(iterator)) { 991 iterator = g_list_next(iterator)) {
991 PurpleSmiley *smiley = (PurpleSmiley *) iterator->data; 992 PurpleSmiley *smiley = (PurpleSmiley *) iterator->data;
992 const gchar *shortcut = purple_smiley_get_shortcut(smiley); 993 const gchar *shortcut = purple_smiley_get_shortcut(smiley);
1009 shortcut, jabber_data_get_cid(new_data)); 1010 shortcut, jabber_data_get_cid(new_data));
1010 jabber_data_associate_local(new_data, shortcut); 1011 jabber_data_associate_local(new_data, shortcut);
1011 } 1012 }
1012 valid_smileys = g_list_append(valid_smileys, smiley); 1013 valid_smileys = g_list_append(valid_smileys, smiley);
1013 } else { 1014 } else {
1014 gchar *msg = 1015 has_too_large_smiley = TRUE;
1015 g_strdup_printf(_("Custom smiley with shortcut %s is too large to send."),
1016 purple_smiley_get_shortcut(smiley));
1017 purple_conversation_write(conv, NULL, msg,
1018 PURPLE_MESSAGE_ERROR, time(NULL));
1019 g_free(msg);
1020 } 1016 }
1017 }
1018
1019 if (has_too_large_smiley) {
1020 purple_conversation_write(conv, NULL,
1021 _("A custom smiley in the message is too large to send."),
1022 PURPLE_MESSAGE_ERROR, time(NULL));
1021 } 1023 }
1022 1024
1023 smileyfied_xhtml = 1025 smileyfied_xhtml =
1024 jabber_message_get_smileyfied_xhtml(xhtml, valid_smileys); 1026 jabber_message_get_smileyfied_xhtml(xhtml, valid_smileys);
1025 g_list_free(found_smileys); 1027 g_list_free(found_smileys);

mercurial