# HG changeset patch # User Richard Laager # Date 1130202028 0 # Node ID 615c2fd3d72eba30b8bfb5ed39446f85da674891 # Parent 648637d0a9313f5a545ee0b560d73e252b381720 [gaim-migrate @ 14096] Use a system message to inform users about the effects of the Enable Logging toggle. committer: Tailor Script diff -r 648637d0a931 -r 615c2fd3d72e src/gtkconv.c --- a/src/gtkconv.c Tue Oct 25 00:58:24 2005 +0000 +++ b/src/gtkconv.c Tue Oct 25 01:00:28 2005 +0000 @@ -1206,14 +1206,40 @@ { GaimGtkWindow *win = data; GaimConversation *conv; + gboolean logging; conv = gaim_gtk_conv_window_get_active_conversation(win); if (conv == NULL) return; - gaim_conversation_set_logging(conv, - gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); + logging = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); + + if (logging == gaim_conversation_is_logging(conv)) + return; + + if (logging) + { + /* Enable logging first so the message below can be logged. */ + gaim_conversation_set_logging(conv, TRUE); + + gaim_conversation_write(conv, NULL, + _("Logging started. Future messages in this conversation will be logged."), + conv->logs ? (GAIM_MESSAGE_SYSTEM) : + (GAIM_MESSAGE_SYSTEM | GAIM_MESSAGE_NO_LOG), + time(NULL)); + } + else + { + gaim_conversation_write(conv, NULL, + _("Logging stopped. Future messages in this conversation will not be logged."), + conv->logs ? (GAIM_MESSAGE_SYSTEM) : + (GAIM_MESSAGE_SYSTEM | GAIM_MESSAGE_NO_LOG), + time(NULL)); + + /* Disable the logging second, so that the above message can be logged. */ + gaim_conversation_set_logging(conv, FALSE); + } } static void