pidgin/gtkimhtml.c

changeset 31192
57ce28c7314f
parent 30706
612b36b49058
child 31208
1dccb087d00a
equal deleted inserted replaced
31191:163f03d8d1d2 31192:57ce28c7314f
4903 * This GtkIMHtml has the maximum number of smileys allowed, so don't 4903 * This GtkIMHtml has the maximum number of smileys allowed, so don't
4904 * add any more. We do this for performance reasons, because smileys 4904 * add any more. We do this for performance reasons, because smileys
4905 * are apparently pretty inefficient. Hopefully we can remove this 4905 * are apparently pretty inefficient. Hopefully we can remove this
4906 * restriction when we're using a better HTML widget. 4906 * restriction when we're using a better HTML widget.
4907 */ 4907 */
4908 unescaped = purple_unescape_html(smiley);
4908 numsmileys_thismsg = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_thismsg")); 4909 numsmileys_thismsg = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_thismsg"));
4909 if (numsmileys_thismsg >= 30) { 4910 if (numsmileys_thismsg >= 30) {
4910 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); 4911 gtk_text_buffer_insert(imhtml->text_buffer, iter, unescaped, -1);
4912 g_free(unescaped);
4911 return; 4913 return;
4912 } 4914 }
4913 numsmileys_total = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_total")); 4915 numsmileys_total = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_total"));
4914 if (numsmileys_total >= 300) { 4916 if (numsmileys_total >= 300) {
4915 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); 4917 gtk_text_buffer_insert(imhtml->text_buffer, iter, unescaped, -1);
4918 g_free(unescaped);
4916 return; 4919 return;
4917 } 4920 }
4918 4921
4919 unescaped = purple_unescape_html(smiley);
4920 imhtml_smiley = gtk_imhtml_smiley_get(imhtml, sml, unescaped); 4922 imhtml_smiley = gtk_imhtml_smiley_get(imhtml, sml, unescaped);
4921 4923
4922 if (imhtml->format_functions & GTK_IMHTML_SMILEY) { 4924 if (imhtml->format_functions & GTK_IMHTML_SMILEY) {
4923 annipixbuf = imhtml_smiley ? gtk_smiley_get_image(imhtml_smiley) : NULL; 4925 annipixbuf = imhtml_smiley ? gtk_smiley_get_image(imhtml_smiley) : NULL;
4924 if (annipixbuf) { 4926 if (annipixbuf) {
4989 } 4991 }
4990 4992
4991 g_object_set_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_thismsg", GINT_TO_POINTER(numsmileys_thismsg + 1)); 4993 g_object_set_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_thismsg", GINT_TO_POINTER(numsmileys_thismsg + 1));
4992 g_object_set_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_total", GINT_TO_POINTER(numsmileys_total + 1)); 4994 g_object_set_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_total", GINT_TO_POINTER(numsmileys_total + 1));
4993 } else { 4995 } else {
4994 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); 4996 gtk_text_buffer_insert(imhtml->text_buffer, iter, unescaped, -1);
4995 } 4997 }
4996 4998
4997 if (ebox) { 4999 if (ebox) {
4998 g_signal_connect(G_OBJECT(ebox), "event", G_CALLBACK(gtk_imhtml_smiley_clicked), imhtml_smiley); 5000 g_signal_connect(G_OBJECT(ebox), "event", G_CALLBACK(gtk_imhtml_smiley_clicked), imhtml_smiley);
4999 } 5001 }

mercurial