X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Fcore%2Fsession.c;h=7ebd8f82b956ef60a21bd2eab624d4b42787c1ac;hp=0248f13e07b6ed2dc8fc02bcfa03662042d27647;hb=382d15d447b7a95390decfa783836ae4fe255b3d;hpb=d47a87b03b846e2333ef57b2c0d81f1644992964 diff --git a/apps/irssi/src/core/session.c b/apps/irssi/src/core/session.c index 0248f13e..7ebd8f82 100644 --- a/apps/irssi/src/core/session.c +++ b/apps/irssi/src/core/session.c @@ -39,6 +39,7 @@ static char **session_args; void session_set_binary(const char *path) { + const char *envpath; char **paths, **tmp; char *str; @@ -59,10 +60,10 @@ void session_set_binary(const char *path) } /* we'll need to find it from path. */ - str = g_getenv("PATH"); - if (str == NULL) return; + envpath = g_getenv("PATH"); + if (envpath == NULL) return; - paths = g_strsplit(str, ":", -1); + paths = g_strsplit(envpath, ":", -1); for (tmp = paths; *tmp != NULL; tmp++) { str = g_strconcat(*tmp, G_DIR_SEPARATOR_S, path, NULL); if (access(str, X_OK) == 0) { @@ -145,7 +146,10 @@ static void session_save_channel(CHANNEL_REC *channel, CONFIG_REC *config, node = config_node_section(node, NULL, NODE_TYPE_BLOCK); config_node_set_str(config, node, "name", channel->name); + config_node_set_str(config, node, "visible_name", channel->visible_name); config_node_set_str(config, node, "topic", channel->topic); + config_node_set_str(config, node, "topic_by", channel->topic_by); + config_node_set_int(config, node, "topic_time", channel->topic_time); config_node_set_str(config, node, "key", channel->key); signal_emit("session save channel", 3, channel, config, node); @@ -178,6 +182,8 @@ static void session_save_server(SERVER_REC *server, CONFIG_REC *config, config_node_set_str(config, node, "password", server->connrec->password); config_node_set_str(config, node, "nick", server->nick); + config_node_set_bool(config, node, "use_ssl", server->connrec->use_ssl); + handle = g_io_channel_unix_get_fd(net_sendbuffer_handle(server->handle)); config_node_set_int(config, node, "handle", handle); @@ -212,14 +218,17 @@ static void session_restore_channel_nicks(CHANNEL_REC *channel, static void session_restore_channel(SERVER_REC *server, CONFIG_NODE *node) { CHANNEL_REC *channel; - const char *name; + const char *name, *visible_name; name = config_node_get_str(node, "name", NULL); if (name == NULL) return; - channel = CHAT_PROTOCOL(server)->channel_create(server, name, TRUE); + visible_name = config_node_get_str(node, "visible_name", NULL); + channel = CHAT_PROTOCOL(server)->channel_create(server, name, visible_name, TRUE); channel->topic = g_strdup(config_node_get_str(node, "topic", NULL)); + channel->topic_by = g_strdup(config_node_get_str(node, "topic_by", NULL)); + channel->topic_time = config_node_get_int(node, "topic_time", 0); channel->key = g_strdup(config_node_get_str(node, "key", NULL)); channel->session_rejoin = TRUE; @@ -269,12 +278,13 @@ static void session_restore_server(CONFIG_NODE *node) chatnet, password, nick); if (conn != NULL) { conn->reconnection = TRUE; + conn->connect_handle = g_io_channel_unix_new(handle); - server = proto->server_connect(conn); - server->handle = net_sendbuffer_create(g_io_channel_unix_new(handle), 0); + server = proto->server_init_connect(conn); server->session_reconnect = TRUE; - signal_emit("session restore server", 2, server, node); + + proto->server_connect(server); } } @@ -347,7 +357,7 @@ void session_init(void) session_file = NULL; args_register(options); - command_bind("upgrade", NULL, (SIGNAL_FUNC) cmd_upgrade); + /*command_bind("upgrade", NULL, (SIGNAL_FUNC) cmd_upgrade);*/ signal_add("session save", (SIGNAL_FUNC) sig_session_save); signal_add("session restore", (SIGNAL_FUNC) sig_session_restore); @@ -362,7 +372,7 @@ void session_deinit(void) { g_free_not_null(irssi_binary); - command_unbind("upgrade", (SIGNAL_FUNC) cmd_upgrade); + /*command_unbind("upgrade", (SIGNAL_FUNC) cmd_upgrade);*/ signal_remove("session save", (SIGNAL_FUNC) sig_session_save); signal_remove("session restore", (SIGNAL_FUNC) sig_session_restore);