mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Merge pull request #1419 from ailin-nemui/init-irc-funcs
move irc server functions to object creation time
(cherry picked from commit a661e2fb35
)
This commit is contained in:
parent
93a94308bd
commit
9a95edc69a
@ -79,11 +79,11 @@ static int ischannel_func(SERVER_REC *server, const char *data)
|
||||
if (*data == '\0')
|
||||
return FALSE;
|
||||
|
||||
chantypes = g_hash_table_lookup(irc_server->isupport, "chantypes");
|
||||
chantypes = g_hash_table_lookup(irc_server->isupport, "CHANTYPES");
|
||||
if (chantypes == NULL)
|
||||
chantypes = "#&!+"; /* normal, local, secure, modeless */
|
||||
|
||||
statusmsg = g_hash_table_lookup(irc_server->isupport, "statusmsg");
|
||||
statusmsg = g_hash_table_lookup(irc_server->isupport, "STATUSMSG");
|
||||
if (statusmsg == NULL && strchr(chantypes, '@') == NULL)
|
||||
statusmsg = "@";
|
||||
|
||||
@ -296,10 +296,11 @@ static void server_init_1(IRC_SERVER_REC *server)
|
||||
irc_cap_toggle(server, CAP_STARTTLS, TRUE);
|
||||
}
|
||||
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
/* set the standards */
|
||||
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
|
||||
if (!g_hash_table_contains(server->isupport, "CHANMODES"))
|
||||
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"),
|
||||
g_strdup("beI,k,l,imnpst"));
|
||||
if (!g_hash_table_contains(server->isupport, "PREFIX"))
|
||||
g_hash_table_insert(server->isupport, g_strdup("PREFIX"), g_strdup("(ohv)@%+"));
|
||||
|
||||
server->cmdcount = 0;
|
||||
@ -466,6 +467,15 @@ SERVER_REC *irc_server_init_connect(SERVER_CONNECT_REC *conn)
|
||||
|
||||
modes_server_init(server);
|
||||
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
server->isnickflag = isnickflag_func;
|
||||
server->ischannel = ischannel_func;
|
||||
server->split_message = split_message;
|
||||
server->send_message = send_message;
|
||||
server->query_find_func = (QUERY_REC * (*) (SERVER_REC *, const char *) ) irc_query_find;
|
||||
server->nick_comp_func = irc_nickcmp_rfc1459;
|
||||
|
||||
server_connect_init((SERVER_REC *) server);
|
||||
return (SERVER_REC *) server;
|
||||
}
|
||||
@ -556,14 +566,6 @@ static void sig_connected(IRC_SERVER_REC *server)
|
||||
if (!IS_IRC_SERVER(server))
|
||||
return;
|
||||
|
||||
server->isnickflag = isnickflag_func;
|
||||
server->ischannel = ischannel_func;
|
||||
server->split_message = split_message;
|
||||
server->send_message = send_message;
|
||||
server->query_find_func =
|
||||
(QUERY_REC *(*)(SERVER_REC *, const char *)) irc_query_find;
|
||||
server->nick_comp_func = irc_nickcmp_rfc1459;
|
||||
|
||||
server->splits = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
if (!server->session_reconnect)
|
||||
|
Loading…
Reference in New Issue
Block a user