diff options
author | Timo Sirainen <cras@irssi.org> | 2000-10-13 22:34:19 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-10-13 22:34:19 +0000 |
commit | f850204479e84c3112b6353da48a5a1ec81bb1fe (patch) | |
tree | 6efbc3de68f6dd3588468119a2d7e5feb7d216e7 /src/irc/core | |
parent | 20bac288f6aca72593d1d13c0f4a5548eb9b80ae (diff) | |
download | irssi-f850204479e84c3112b6353da48a5a1ec81bb1fe.zip |
"/WHOIS *" requires -yes option to work.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@738 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core')
-rw-r--r-- | src/irc/core/irc-commands.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index 170921c4..6a7bb25f 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -410,6 +410,7 @@ static char *get_redirect_nicklist(const char *nicks, int *free) /* SYNTAX: WHOIS [<server>] [<nicks>] */ static void cmd_whois(const char *data, IRC_SERVER_REC *server) { + GHashTable *optlist; char *qserver, *query; void *free_arg; int free_nick; @@ -418,15 +419,19 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server) if (!IS_IRC_SERVER(server) || !server->connected) cmd_return_error(CMDERR_NOT_CONNECTED); - if (!cmd_get_params(data, &free_arg, 2, &qserver, &query)) + if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTIONS, + "whois", &optlist, &qserver, &query)) return; if (*query == '\0') { - cmd_params_free(free_arg); - if (!cmd_get_params(data, &free_arg, 1, &query)) return; + query = qserver; qserver = ""; } - if (*query == '\0') query = server->nick; + if (*query == '\0') query = server->nick; + + if (strcmp(query, "*") == 0 && + g_hash_table_lookup(optlist, "yes") == NULL) + cmd_param_error(CMDERR_NOT_GOOD_IDEA); if (*qserver == '\0') g_string_sprintf(tmpstr, "WHOIS %s", query); @@ -985,6 +990,7 @@ void irc_commands_init(void) command_set_options("topic", "delete"); command_set_options("list", "yes"); command_set_options("away", "one all"); + command_set_options("whois", "yes"); } void irc_commands_deinit(void) |