summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-09-30 21:43:46 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-09-30 21:43:46 +0000
commit525773aa80b3bc441768d49be82dd1ddd5f583a1 (patch)
treedda212a4ffb8d2c3ded43d1ef958a014d75e6aec /src
parent28faa953be748ef4cd0b615e2925fbeecb35827f (diff)
downloadirssi-525773aa80b3bc441768d49be82dd1ddd5f583a1.zip
If reconnection was aborted by trying to reconnect to another server, the
channels and usermode wasn't restored. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2934 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/servers-reconnect.c11
-rw-r--r--src/irc/core/irc-servers-reconnect.c3
2 files changed, 13 insertions, 1 deletions
diff --git a/src/core/servers-reconnect.c b/src/core/servers-reconnect.c
index a095f3c4..79d65aab 100644
--- a/src/core/servers-reconnect.c
+++ b/src/core/servers-reconnect.c
@@ -44,6 +44,17 @@ void reconnect_save_status(SERVER_CONNECT_REC *conn, SERVER_REC *server)
conn->away_reason = !server->usermode_away ? NULL :
g_strdup(server->away_reason);
+ if (!server->connected) {
+ /* default to channels/usermode from connect record
+ since server isn't fully connected yet */
+ g_free_not_null(conn->channels);
+ conn->channels = server->connrec->no_autojoin_channels ? NULL :
+ g_strdup(server->connrec->channels);
+
+ g_free_not_null(conn->channels);
+ conn->channels = g_strdup(server->connrec->channels);
+ }
+
signal_emit("server reconnect save status", 2, conn, server);
}
diff --git a/src/irc/core/irc-servers-reconnect.c b/src/irc/core/irc-servers-reconnect.c
index 1c6865de..07b39b88 100644
--- a/src/irc/core/irc-servers-reconnect.c
+++ b/src/irc/core/irc-servers-reconnect.c
@@ -52,7 +52,8 @@ static void sig_server_connect_copy(SERVER_CONNECT_REC **dest,
static void sig_server_reconnect_save_status(IRC_SERVER_CONNECT_REC *conn,
IRC_SERVER_REC *server)
{
- if (!IS_IRC_SERVER_CONNECT(conn) || !IS_IRC_SERVER(server))
+ if (!IS_IRC_SERVER_CONNECT(conn) || !IS_IRC_SERVER(server) ||
+ !server->connected)
return;
g_free_not_null(conn->channels);