Moved autoconnects and command line parameter parsing from irc to core.

Added not_initialized parameter to chat protocols that are created
using chat_protocol_get_unknown(). /CONNECT doesn't crash now with
non-initialized protocols but instead complains about them.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1248 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-19 02:50:08 +00:00 committed by cras
commit 1117638b52
10 changed files with 122 additions and 91 deletions

View file

@ -66,6 +66,14 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr)
if (proto == NULL)
proto = chat_protocol_find_id(conn->chat_type);
if (proto->not_initialized) {
/* trying to use protocol that isn't yet initialized */
signal_emit("chat protocol unknown", 1, proto->name);
server_connect_free(conn);
cmd_params_free(free_arg);
return NULL;
}
if (g_hash_table_lookup(optlist, "6") != NULL)
conn->family = AF_INET6;
else if (g_hash_table_lookup(optlist, "4") != NULL)

View file

@ -202,7 +202,8 @@ CHAT_PROTOCOL_REC *chat_protocol_get_unknown(const char *name)
if (rec != NULL)
return rec;
rec = g_new0(CHAT_PROTOCOL_REC, 1);
rec = g_new0(CHAT_PROTOCOL_REC, 1);
rec->not_initialized = TRUE;
rec->name = (char *) name;
rec->create_chatnet = create_chatnet;
rec->create_server_setup = create_server_setup;

View file

@ -4,6 +4,8 @@
typedef struct {
int id;
unsigned int not_initialized:1;
char *name;
char *fullname;
char *chatnet;