src/gtkconv.c

changeset 11805
eb030ba45cfd
parent 11799
74883295cbcc
child 11812
1dc4177239f9
equal deleted inserted replaced
11804:9a98a2cead46 11805:eb030ba45cfd
1204 static void 1204 static void
1205 menu_logging_cb(gpointer data, guint action, GtkWidget *widget) 1205 menu_logging_cb(gpointer data, guint action, GtkWidget *widget)
1206 { 1206 {
1207 GaimGtkWindow *win = data; 1207 GaimGtkWindow *win = data;
1208 GaimConversation *conv; 1208 GaimConversation *conv;
1209 gboolean logging;
1209 1210
1210 conv = gaim_gtk_conv_window_get_active_conversation(win); 1211 conv = gaim_gtk_conv_window_get_active_conversation(win);
1211 1212
1212 if (conv == NULL) 1213 if (conv == NULL)
1213 return; 1214 return;
1214 1215
1215 gaim_conversation_set_logging(conv, 1216 logging = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
1216 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); 1217
1218 if (logging == gaim_conversation_is_logging(conv))
1219 return;
1220
1221 if (logging)
1222 {
1223 /* Enable logging first so the message below can be logged. */
1224 gaim_conversation_set_logging(conv, TRUE);
1225
1226 gaim_conversation_write(conv, NULL,
1227 _("Logging started. Future messages in this conversation will be logged."),
1228 conv->logs ? (GAIM_MESSAGE_SYSTEM) :
1229 (GAIM_MESSAGE_SYSTEM | GAIM_MESSAGE_NO_LOG),
1230 time(NULL));
1231 }
1232 else
1233 {
1234 gaim_conversation_write(conv, NULL,
1235 _("Logging stopped. Future messages in this conversation will not be logged."),
1236 conv->logs ? (GAIM_MESSAGE_SYSTEM) :
1237 (GAIM_MESSAGE_SYSTEM | GAIM_MESSAGE_NO_LOG),
1238 time(NULL));
1239
1240 /* Disable the logging second, so that the above message can be logged. */
1241 gaim_conversation_set_logging(conv, FALSE);
1242 }
1217 } 1243 }
1218 1244
1219 static void 1245 static void
1220 menu_toolbar_cb(gpointer data, guint action, GtkWidget *widget) 1246 menu_toolbar_cb(gpointer data, guint action, GtkWidget *widget)
1221 { 1247 {

mercurial