mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 16:12:30 +02:00
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:
parent
42634d83bc
commit
1117638b52
10 changed files with 122 additions and 91 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
typedef struct {
|
||||
int id;
|
||||
|
||||
unsigned int not_initialized:1;
|
||||
|
||||
char *name;
|
||||
char *fullname;
|
||||
char *chatnet;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue