summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-02-24 23:15:23 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-02-24 23:15:23 +0100
commit27d1d81f98727dde34a1dae5c118c3cd9b13b18a (patch)
tree13ce1100433b792a76b476f8010e40a86f6e5af9 /src
parentb7513da92b969fa681dd9d21ae8930e90a7ee4ca (diff)
downloadweechat-27d1d81f98727dde34a1dae5c118c3cd9b13b18a.zip
Command /whois is now authorized in private without argument (task #7482)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-command.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 80723a07a..f31146157 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -3441,7 +3441,7 @@ int
irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
- IRC_GET_SERVER(buffer);
+ IRC_GET_SERVER_CHANNEL(buffer);
if (!ptr_server || !ptr_server->is_connected)
return WEECHAT_RC_ERROR;
@@ -3453,7 +3453,12 @@ irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc,
irc_server_sendf (ptr_server, "WHOIS %s", argv_eol[1]);
else
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "whois");
+ if (ptr_channel
+ && ((ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
+ || (ptr_channel->type == IRC_CHANNEL_TYPE_DCC_CHAT)))
+ irc_server_sendf (ptr_server, "WHOIS %s", ptr_channel->name);
+ else
+ IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "whois");
}
return WEECHAT_RC_OK;