# HG changeset patch # User Mark Doliner # Date 1079315079 0 # Node ID ebb160ec42afc453cf2ea56762dd4a4d6675f654 # Parent be4cf7c09ca3042f5d271d17d5f03c59e78cb0d7 [gaim-migrate @ 9178] Another rad patch from SimGuy: This patch adds the proper check in to prevent users from sending blank lines, even if they contain markup. It also seems to resolve the problem where in ICQ and MSN, you can't send a smiley if it's alone on a line. I'm not sure why this is fixed so it might have been a coincidence. I took the opportunity to clean up the send_cb function, so it's got some deprecated and/or commented code removed. And hey, if you open an empty conv with someone and click the bold button and then hit enter it gives you a gtk warning. Somebody fix that. Gtk: file gtktextbuffer.c: line 1794 (gtk_text_buffer_get_iter_at_mark): assertion `GTK_IS_TEXT_MARK (mark)' failed committer: Tailor Script diff -r be4cf7c09ca3 -r ebb160ec42af src/gtkconv.c --- a/src/gtkconv.c Mon Mar 15 01:35:10 2004 +0000 +++ b/src/gtkconv.c Mon Mar 15 01:44:39 2004 +0000 @@ -281,30 +281,18 @@ send_cb(GtkWidget *widget, GaimConversation *conv) { GaimGtkConversation *gtkconv; - char *buf; - GaimConnection *gc = gaim_conversation_get_gc(conv); + char *buf, *clean; gtkconv = GAIM_GTK_CONVERSATION(conv); - buf = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); - - /* set_toggle(gtkconv->toolbar.bold, FALSE); - set_toggle(gtkconv->toolbar.italic, FALSE); - set_toggle(gtkconv->toolbar.underline, FALSE); - set_toggle(gtkconv->toolbar.larger_size, FALSE); - set_toggle(gtkconv->toolbar.normal_size, FALSE); - set_toggle(gtkconv->toolbar.smaller_size,FALSE); - set_toggle(gtkconv->toolbar.font, FALSE); - set_toggle(gtkconv->toolbar.fgcolor, FALSE); - set_toggle(gtkconv->toolbar.bgcolor, FALSE); - set_toggle(gtkconv->toolbar.link, FALSE); - */ + clean = gaim_markup_strip_html(buf); + gtk_widget_grab_focus(gtkconv->entry); - if (strlen(buf) == 0) { + if (strlen(clean) == 0) { + g_free(clean); g_free(buf); - return; } @@ -317,6 +305,7 @@ gaim_conv_window_hide(gaim_conversation_get_window(conv)); g_free(buf); + g_free(clean); gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); default_formatize(conv);