changeset 9602:00e678a71a7f

[gaim-migrate @ 10445] This makes us not think what you typed was a command if it's a smiley. Note this only applies to smileys that appear as graphics. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Tue, 27 Jul 2004 00:40:45 +0000
parents b94fe6153785
children 10939dc36eac
files src/gtkconv.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Tue Jul 27 00:32:11 2004 +0000
+++ b/src/gtkconv.c	Tue Jul 27 00:40:45 2004 +0000
@@ -401,18 +401,22 @@
 		return;
 
 	if(gaim_prefs_get_bool("/gaim/gtk/conversations/enable_commands")) {
+		GtkTextIter start;
 		cmd = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry), NULL, NULL);
-		if(cmd && (strncmp(cmd, prefix, strlen(prefix)) == 0)) {
+		gtk_text_buffer_get_start_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &start);
+
+		if(cmd && (strncmp(cmd, prefix, strlen(prefix)) == 0)
+		   && !gtk_text_iter_get_child_anchor(&start)) {
 			GaimCmdStatus status;
 			char *error, *cmdline, *markup, *send_history;
-			GtkTextIter start, end;
+			GtkTextIter end;
 
 			send_history = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry));
 			send_history_add(conv, send_history);
 			g_free(send_history);
 
 			cmdline = cmd + strlen(prefix);
-			gtk_text_buffer_get_start_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &start);
+
 			gtk_text_iter_forward_chars(&start, g_utf8_strlen(prefix, -1));
 			gtk_text_buffer_get_end_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &end);
 			markup = gtk_imhtml_get_markup_range(GTK_IMHTML(gtkconv->entry), &start, &end);