summary refs log tree commit diff stats
path: root/src/common/chanopt.c
diff options
context:
space:
mode:
authorleeter <leeterfp@gmail.com>2014-12-10 14:40:42 -0500
committerTingPing <tingping@tingping.se>2014-12-10 14:40:42 -0500
commit6aafc8e51d17f0bd92f1ec46567a5b1597e7e799 (patch)
tree3159bc195bef1878bd06932f6b38c427dc946305 /src/common/chanopt.c
parent10246f121a9dfb1fe38012aa92324ac6050822a2 (diff)
Fix chanopts not saving if /quit before exit
This is the C fix, unfortunately a proper fix, e.g.
 removing the dependency on session_name all together is a much vaster
 refactor outside the scope of this bugfix.

Closes #1111
Diffstat (limited to 'src/common/chanopt.c')
-rw-r--r--src/common/chanopt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/chanopt.c b/src/common/chanopt.c
index 820a31fb..92466ce9 100644
--- a/src/common/chanopt.c
+++ b/src/common/chanopt.c
@@ -119,7 +119,7 @@ chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[])
 	if (!quiet)
 		PrintTextf (sess, "\002Network\002: %s \002Channel\002: %s\n",
 						sess->server->network ? server_get_network (sess->server, TRUE) : _("<none>"),
-						sess->channel[0] ? sess->channel : _("<none>"));
+						sess->session_name[0] ? sess->session_name : _("<none>"));
 
 	while (i < sizeof (chanopt) / sizeof (channel_options))
 	{
@@ -298,7 +298,7 @@ chanopt_load (session *sess)
 	chanopt_in_memory *co;
 	char *network;
 
-	if (sess->channel[0] == 0)
+	if (sess->session_name[0] == 0)
 		return;
 
 	network = server_get_network (sess->server, FALSE);
@@ -311,7 +311,7 @@ chanopt_load (session *sess)
 		chanopt_load_all ();
 	}
 
-	co = chanopt_find (network, sess->channel, FALSE);
+	co = chanopt_find (network, sess->session_name, FALSE);
 	if (!co)
 		return;
 
@@ -334,7 +334,7 @@ chanopt_save (session *sess)
 	chanopt_in_memory *co;
 	char *network;
 
-	if (sess->channel[0] == 0)
+	if (sess->session_name[0] == 0)
 		return;
 
 	network = server_get_network (sess->server, FALSE);
@@ -343,7 +343,7 @@ chanopt_save (session *sess)
 
 	/* 2. reconcile sess with what we loaded from disk */
 
-	co = chanopt_find (network, sess->channel, TRUE);
+	co = chanopt_find (network, sess->session_name, TRUE);
 
 	i = 0;
 	while (i < sizeof (chanopt) / sizeof (channel_options))