1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Add the server specific functions immediately after the server

connection is started, not after the connection is successfully
finished.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@782 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-10-22 15:46:28 +00:00 committed by cras
parent 9b459cfe46
commit c6808b3724
2 changed files with 15 additions and 6 deletions

View File

@ -187,7 +187,7 @@ static CHANNEL_REC *irc_channel_find_server(SERVER_REC *server,
return NULL; return NULL;
} }
static void sig_connected(SERVER_REC *server) static void sig_server_looking(SERVER_REC *server)
{ {
if (!IS_IRC_SERVER(server)) if (!IS_IRC_SERVER(server))
return; return;
@ -199,7 +199,7 @@ static void sig_connected(SERVER_REC *server)
void irc_channels_init(void) void irc_channels_init(void)
{ {
signal_add("channel create", (SIGNAL_FUNC) sig_channel_create); signal_add("channel create", (SIGNAL_FUNC) sig_channel_create);
signal_add("server connected", (SIGNAL_FUNC) sig_connected); signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_add("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed); signal_add("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
channel_events_init(); channel_events_init();
@ -217,7 +217,7 @@ void irc_channels_init(void)
void irc_channels_deinit(void) void irc_channels_deinit(void)
{ {
signal_remove("channel create", (SIGNAL_FUNC) sig_channel_create); signal_remove("channel create", (SIGNAL_FUNC) sig_channel_create);
signal_remove("server connected", (SIGNAL_FUNC) sig_connected); signal_remove("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed); signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
channel_events_deinit(); channel_events_deinit();

View File

@ -86,6 +86,16 @@ static void send_message(IRC_SERVER_REC *server, const char *target,
g_free(str); g_free(str);
} }
static void sig_server_looking(IRC_SERVER_REC *server)
{
if (!IS_IRC_SERVER(server))
return;
server->isnickflag = isnickflag_func;
server->ischannel = ischannel_func;
server->send_message = (void *) send_message;
}
static void server_init(IRC_SERVER_REC *server) static void server_init(IRC_SERVER_REC *server)
{ {
IRC_SERVER_CONNECT_REC *conn; IRC_SERVER_CONNECT_REC *conn;
@ -125,9 +135,6 @@ static void server_init(IRC_SERVER_REC *server)
address, conn->realname); address, conn->realname);
server->cmdcount = 0; server->cmdcount = 0;
server->isnickflag = isnickflag_func;
server->ischannel = ischannel_func;
server->send_message = (void *) send_message;
} }
IRC_SERVER_REC *irc_server_connect(IRC_SERVER_CONNECT_REC *conn) IRC_SERVER_REC *irc_server_connect(IRC_SERVER_CONNECT_REC *conn)
@ -437,6 +444,7 @@ void irc_servers_init(void)
signal_add("server connect free", (SIGNAL_FUNC) sig_server_connect_free); signal_add("server connect free", (SIGNAL_FUNC) sig_server_connect_free);
signal_add("server connect", (SIGNAL_FUNC) sig_server_connect); signal_add("server connect", (SIGNAL_FUNC) sig_server_connect);
signal_add_first("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_add_first("server connected", (SIGNAL_FUNC) sig_connected); signal_add_first("server connected", (SIGNAL_FUNC) sig_connected);
signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected); signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected);
signal_add_last("server quit", (SIGNAL_FUNC) sig_server_quit); signal_add_last("server quit", (SIGNAL_FUNC) sig_server_quit);
@ -463,6 +471,7 @@ void irc_servers_deinit(void)
signal_remove("server connect free", (SIGNAL_FUNC) sig_server_connect_free); signal_remove("server connect free", (SIGNAL_FUNC) sig_server_connect_free);
signal_remove("server connect", (SIGNAL_FUNC) sig_server_connect); signal_remove("server connect", (SIGNAL_FUNC) sig_server_connect);
signal_remove("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_remove("server connected", (SIGNAL_FUNC) sig_connected); signal_remove("server connected", (SIGNAL_FUNC) sig_connected);
signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected); signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
signal_remove("server quit", (SIGNAL_FUNC) sig_server_quit); signal_remove("server quit", (SIGNAL_FUNC) sig_server_quit);