summaryrefslogtreecommitdiff
path: root/src/irc/core/irc-commands.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-10-14 14:37:01 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-10-14 14:37:01 +0000
commit5733a8c6e39ef869aaec89ac3044a8249d1927d3 (patch)
tree07942c175d70fef457e52594e82a914d6f5f1abf /src/irc/core/irc-commands.c
parent148a6692e63a1928cf56e1d57d7b4c95ce3c8ad9 (diff)
downloadirssi-5733a8c6e39ef869aaec89ac3044a8249d1927d3.zip
/WHOIS in a query asks the queried nick's whois.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@753 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core/irc-commands.c')
-rw-r--r--src/irc/core/irc-commands.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c
index 6a7bb25f..ebbdf59b 100644
--- a/src/irc/core/irc-commands.c
+++ b/src/irc/core/irc-commands.c
@@ -408,7 +408,8 @@ 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)
+static void cmd_whois(const char *data, IRC_SERVER_REC *server,
+ WI_ITEM_REC *item)
{
GHashTable *optlist;
char *qserver, *query;
@@ -427,7 +428,10 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server)
query = qserver;
qserver = "";
}
- if (*query == '\0') query = server->nick;
+ if (*query == '\0') {
+ QUERY_REC *queryitem = QUERY(item);
+ query = queryitem != NULL ? queryitem->name : server->nick;
+ }
if (strcmp(query, "*") == 0 &&
g_hash_table_lookup(optlist, "yes") == NULL)