| 447 |
447 |
| 448 first = g_list_first(gtkconv->send_history); |
448 first = g_list_first(gtkconv->send_history); |
| 449 g_free(first->data); |
449 g_free(first->data); |
| 450 first->data = g_strdup(message); |
450 first->data = g_strdup(message); |
| 451 gtkconv->send_history = g_list_prepend(first, NULL); |
451 gtkconv->send_history = g_list_prepend(first, NULL); |
| |
452 } |
| |
453 |
| |
454 static void |
| |
455 reset_default_size(GaimGtkConversation *gtkconv) |
| |
456 { |
| |
457 GaimConversation *conv = gtkconv->active_conv; |
| |
458 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) |
| |
459 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, |
| |
460 gaim_prefs_get_int("/gaim/gtk/conversations/chat/entry_height")); |
| |
461 else |
| |
462 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, |
| |
463 gaim_prefs_get_int("/gaim/gtk/conversations/im/entry_height")); |
| 452 } |
464 } |
| 453 |
465 |
| 454 static gboolean |
466 static gboolean |
| 455 check_for_and_do_command(GaimConversation *conv) |
467 check_for_and_do_command(GaimConversation *conv) |
| 456 { |
468 { |
| 535 if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) && |
547 if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) && |
| 536 gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))) |
548 gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))) |
| 537 return; |
549 return; |
| 538 |
550 |
| 539 if (check_for_and_do_command(conv)) { |
551 if (check_for_and_do_command(conv)) { |
| |
552 if (gtkconv->entry_growing) { |
| |
553 reset_default_size(gtkconv); |
| |
554 gtkconv->entry_growing = FALSE; |
| |
555 } |
| 540 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); |
556 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); |
| 541 return; |
557 return; |
| 542 } |
558 } |
| 543 |
559 |
| 544 buf = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); |
560 buf = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); |
| 584 |
600 |
| 585 g_free(clean); |
601 g_free(clean); |
| 586 g_free(buf); |
602 g_free(buf); |
| 587 |
603 |
| 588 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); |
604 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); |
| |
605 if (gtkconv->entry_growing) { |
| |
606 reset_default_size(gtkconv); |
| |
607 gtkconv->entry_growing = FALSE; |
| |
608 } |
| 589 gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); |
609 gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); |
| 590 } |
610 } |
| 591 |
611 |
| 592 static void |
612 static void |
| 593 add_remove_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) |
613 add_remove_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) |
| 3990 height += (oneline.height + pad_inside) * (wrapped_lines - lines); |
4010 height += (oneline.height + pad_inside) * (wrapped_lines - lines); |
| 3991 |
4011 |
| 3992 gtk_widget_size_request(gtkconv->lower_hbox, &sr); |
4012 gtk_widget_size_request(gtkconv->lower_hbox, &sr); |
| 3993 if (sr.height < height + GAIM_HIG_BOX_SPACE) { |
4013 if (sr.height < height + GAIM_HIG_BOX_SPACE) { |
| 3994 gtkconv->auto_resize = TRUE; |
4014 gtkconv->auto_resize = TRUE; |
| |
4015 gtkconv->entry_growing = TRUE; |
| 3995 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, height + GAIM_HIG_BOX_SPACE); |
4016 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, height + GAIM_HIG_BOX_SPACE); |
| 3996 g_idle_add(reset_auto_resize_cb, gtkconv); |
4017 g_idle_add(reset_auto_resize_cb, gtkconv); |
| 3997 } |
4018 } |
| 3998 } |
4019 } |
| 3999 |
4020 |