summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-06-06 19:16:50 -0400
committerTingPing <tingping@tingping.se>2013-06-06 19:16:50 -0400
commit0e420fbee80ec3c6aa4f73915d832cf22b121e73 (patch)
tree44fef9d0b32083a1e372674a70470b6f46a6269f
parentcf505b850bb02e7b691fbd5f48618d66fe55bc0a (diff)
Save chanopt after any changes
-rw-r--r--src/common/chanopt.c7
-rw-r--r--src/common/outbound.c7
-rw-r--r--src/fe-gtk/maingui.c4
3 files changed, 13 insertions, 5 deletions
diff --git a/src/common/chanopt.c b/src/common/chanopt.c
index 9e841cb6..820a31fb 100644
--- a/src/common/chanopt.c
+++ b/src/common/chanopt.c
@@ -128,6 +128,7 @@ chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[])
 			if (newval != -1)	/* set new value */
 			{
 				*(guint8 *)G_STRUCT_MEMBER_P(sess, chanopt[i].offset) = newval;
+				chanopt_changed = TRUE;
 			}
 
 			if (!quiet)	/* print value */
@@ -436,11 +437,9 @@ cont:
 
 	close (fh);
 
-	/* we're quiting, no need to free */
-
-	/*g_slist_free (chanopt_list);
+	g_slist_free (chanopt_list);
 	chanopt_list = NULL;
 
 	chanopt_open = FALSE;
-	chanopt_changed = FALSE;*/
+	chanopt_changed = FALSE;
 }
diff --git a/src/common/outbound.c b/src/common/outbound.c
index e6113488..95c8a354 100644
--- a/src/common/outbound.c
+++ b/src/common/outbound.c
@@ -575,8 +575,13 @@ cmd_unban (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 static int
 cmd_chanopt (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 {
+	int ret;
+	
 	/* chanopt.c */
-	return chanopt_command (sess, tbuf, word, word_eol);
+	ret = chanopt_command (sess, tbuf, word, word_eol);
+	chanopt_save_all ();
+	
+	return ret;
 }
 
 static int
diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c
index f049d2a6..473b6c11 100644
--- a/src/fe-gtk/maingui.c
+++ b/src/fe-gtk/maingui.c
@@ -32,6 +32,7 @@
 #include "../common/url.h"
 #include "../common/util.h"
 #include "../common/text.h"
+#include "../common/chanopt.h"
 
 #include "fe-gtk.h"
 #include "banlist.h"
@@ -1537,6 +1538,9 @@ mg_set_guint8 (GtkCheckMenuItem *item, guint8 *setting)
 	/* has the logging setting changed? */
 	if (logging != sess->text_logging)
 		log_open_or_close (sess);
+
+	chanopt_save (sess);
+	chanopt_save_all ();
 }
 
 static void