Patch from 'goutnet' to not insert smileys when pasting as plain text. next.minor

Mon, 26 Nov 2007 10:12:41 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Mon, 26 Nov 2007 10:12:41 +0000
branch
next.minor
changeset 22003
904ebe8d6058
parent 22002
f7ce39d4f36f
child 22004
e55427689aba

Patch from 'goutnet' to not insert smileys when pasting as plain text.
This closes #3286.

ChangeLog.API file | annotate | diff | comparison | revisions
pidgin/gtkimhtml.c file | annotate | diff | comparison | revisions
pidgin/gtkimhtml.h file | annotate | diff | comparison | revisions
--- a/ChangeLog.API	Mon Nov 26 09:49:59 2007 +0000
+++ b/ChangeLog.API	Mon Nov 26 10:12:41 2007 +0000
@@ -11,6 +11,8 @@
 		  added utility functions pidgin_dialog_get_vbox_with_properties,
 		  pidgin_dialog_get_vbox, pidgin_dialog_get_action_area to access the
 		  contents in the created dialog. (Peter 'fmoo' Ruibal)
+		* GTK_IMHTML_NO_SMILEY for GtkIMHtmlOptions means not to look for
+		  smileys in the text. (goutnet)
 
 version 2.3.0 (11/24/2007):
 	libpurple:
--- a/pidgin/gtkimhtml.c	Mon Nov 26 09:49:59 2007 +0000
+++ b/pidgin/gtkimhtml.c	Mon Nov 26 10:12:41 2007 +0000
@@ -1010,7 +1010,7 @@
 static void imhtml_paste_insert(GtkIMHtml *imhtml, const char *text, gboolean plaintext)
 {
 	GtkTextIter iter;
-	GtkIMHtmlOptions flags = plaintext ? 0 : (GTK_IMHTML_NO_NEWLINE | GTK_IMHTML_NO_COMMENTS);
+	GtkIMHtmlOptions flags = plaintext ? GTK_IMHTML_NO_SMILEY : (GTK_IMHTML_NO_NEWLINE | GTK_IMHTML_NO_COMMENTS);
 
 	if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, NULL, NULL))
 		gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
@@ -2980,6 +2980,7 @@
 			pos += tlen;
 			g_free(tag); /* This was allocated back in VALID_TAG() */
 		} else if (imhtml->edit.link == NULL &&
+				!(options & GTK_IMHTML_NO_SMILEY) &&
 				gtk_imhtml_is_smiley(imhtml, fonts, c, &smilelen)) {
 			GtkIMHtmlFontDetail *fd;
 			gchar *sml = NULL;
--- a/pidgin/gtkimhtml.h	Mon Nov 26 09:49:59 2007 +0000
+++ b/pidgin/gtkimhtml.h	Mon Nov 26 10:12:41 2007 +0000
@@ -225,7 +225,8 @@
 	GTK_IMHTML_RETURN_LOG          = 1 << 7,
 	GTK_IMHTML_USE_POINTSIZE       = 1 << 8,
 	GTK_IMHTML_NO_FORMATTING       = 1 << 9,
-	GTK_IMHTML_USE_SMOOTHSCROLLING = 1 << 10
+	GTK_IMHTML_USE_SMOOTHSCROLLING = 1 << 10,
+	GTK_IMHTML_NO_SMILEY           = 1 << 11,
 } GtkIMHtmlOptions;
 
 enum {

mercurial