changeset 11805:615c2fd3d72e

[gaim-migrate @ 14096] Use a system message to inform users about the effects of the Enable Logging toggle. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 25 Oct 2005 01:00:28 +0000
parents 648637d0a931
children 7584d802f0ac
files src/gtkconv.c
diffstat 1 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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