diff options
author | Timo Sirainen <cras@irssi.org> | 2000-06-15 20:56:58 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-06-15 20:56:58 +0000 |
commit | cf75515274e9d20c48a2d40300981e7f2c5a0726 (patch) | |
tree | 41ccd9641e6c5f4e9ca088eb2fc87446860bf4fe /src/fe-common/irc/fe-ircnet.c | |
parent | 91396de7403c8d6080307ea529d84b5b381d80f9 (diff) | |
download | irssi-cf75515274e9d20c48a2d40300981e7f2c5a0726.zip |
You can specify command(s) to be sent automatically to server after
connected with /IRCNET -autosendcmd. Useful for IRC networks with
NickServ. Patch by <Tommi.Komulainen@iki.fi>
Ability to send a command automatically to server IRC network
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@354 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-ircnet.c')
-rw-r--r-- | src/fe-common/irc/fe-ircnet.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index 2ebbc3af..88e1d806 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -52,6 +52,8 @@ static void cmd_ircnet_list(void) g_string_sprintfa(str, "realname: %s, ", rec->realname); if (rec->own_host != NULL) g_string_sprintfa(str, "host: %s, ", rec->own_host); + if (rec->autosendcmd != NULL) + g_string_sprintfa(str, "autosendcmd: %s, ", rec->autosendcmd); if (rec->cmd_queue_speed > 0) g_string_sprintfa(str, "cmdspeed: %d, ", rec->cmd_queue_speed); @@ -78,13 +80,14 @@ static void cmd_ircnet_list(void) static void cmd_ircnet_add(const char *data) { char *params, *args, *kicks, *msgs, *modes, *whois; - char *cmdspeed, *cmdmax, *nick, *user, *realname, *host, *name; + char *cmdspeed, *cmdmax, *nick, *user, *realname, *host, *autosendcmd, *name; IRCNET_REC *rec; - args = "kicks msgs modes whois cmdspeed cmdmax nick user realname host"; - params = cmd_get_params(data, 12 | PARAM_FLAG_MULTIARGS, &args, + args = "kicks msgs modes whois cmdspeed cmdmax nick user realname host autosendcmd"; + params = cmd_get_params(data, 13 | PARAM_FLAG_MULTIARGS, &args, &kicks, &msgs, &modes, &whois, &cmdspeed, - &cmdmax, &nick, &user, &realname, &host, &name); + &cmdmax, &nick, &user, &realname, &host, + &autosendcmd, &name); if (*name == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); rec = ircnet_find(name); @@ -99,6 +102,7 @@ static void cmd_ircnet_add(const char *data) g_free_and_null(rec->own_host); rec->own_ip = NULL; } + if (stristr(args, "-autosendcmd")) g_free_and_null(rec->autosendcmd); } if (stristr(args, "-kicks")) rec->max_kicks = atoi(kicks); @@ -116,6 +120,7 @@ static void cmd_ircnet_add(const char *data) rec->own_host = g_strdup(host); rec->own_ip = NULL; } + if (*autosendcmd != '\0') rec->autosendcmd = g_strdup(autosendcmd); ircnet_create(rec); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IRCNET_ADDED, name); |