summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-15 08:26:12 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-15 08:26:12 +0000
commitb76b41aa6f918d53d35fcb755d7894d187db7f84 (patch)
tree6b658f3e5644670cce6ad95e0243481b4b2fc5bf
parente30c1b4f8e3d74712d8e474277dc350082aa9f75 (diff)
downloadirssi-b76b41aa6f918d53d35fcb755d7894d187db7f84.zip
server->real_address wasn't restored properly after /UPGRADE and that
started to raise lag (or maybe crash). Also removed some backwards compatibility code. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2442 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/irc/core/irc-session.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/irc/core/irc-session.c b/src/irc/core/irc-session.c
index c72a6165..f73c86e1 100644
--- a/src/irc/core/irc-session.c
+++ b/src/irc/core/irc-session.c
@@ -67,10 +67,6 @@ static void sig_session_restore_server(IRC_SERVER_REC *server,
server->usermode = g_strdup(config_node_get_str(node, "usermode", NULL));
server->usermode_away = config_node_get_bool(node, "usermode_away", FALSE);
server->away_reason = g_strdup(config_node_get_str(node, "away_reason", NULL));
-
- /* FIXME: remove before .99 */
- g_free_not_null(server->connrec->channels);
- server->connrec->channels = g_strdup(config_node_get_str(node, "channels", NULL));
}
static void sig_session_restore_nick(IRC_CHANNEL_REC *channel,
@@ -100,33 +96,32 @@ static void session_restore_channel(IRC_CHANNEL_REC *channel)
signal_emit("event join", 4, channel->server, channel->name,
channel->server->nick, channel->server->userhost);
- if (nicklist_find(CHANNEL(channel), channel->server->nick) == NULL) {
- /* FIXME: remove before .99 */
- irc_send_cmdv(channel->server, "NAMES %s", channel->name);
- } else {
- data = g_strconcat(channel->server->nick, " ", channel->name, NULL);
- signal_emit("event 366", 2, channel->server, data);
- g_free(data);
- }
+ data = g_strconcat(channel->server->nick, " ", channel->name, NULL);
+ signal_emit("event 366", 2, channel->server, data);
+ g_free(data);
}
static void sig_connected(IRC_SERVER_REC *server)
{
GSList *tmp;
- char *str;
+ char *str, *addr;
if (!IS_IRC_SERVER(server) || !server->session_reconnect)
return;
str = g_strdup_printf("%s :Restoring connection to %s",
server->nick, server->connrec->address);
- signal_emit("event 001", 3, server, str, server->real_address);
+ /* addr needs to be strdup'd because the event_connected() handler
+ free()'s the server->real_address and then tries to strdup() the
+ given origin again */
+ addr = g_strdup(server->real_address);
+ signal_emit("event 001", 3, server, str, addr);
+ g_free(addr);
g_free(str);
for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
IRC_CHANNEL_REC *rec = tmp->data;
- rec->session_rejoin = TRUE; /* FIXME: remove after .99 */
if (rec->session_rejoin)
session_restore_channel(rec);
}