aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--degesch.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/degesch.c b/degesch.c
index 897f1c1..4bdaaba 100644
--- a/degesch.c
+++ b/degesch.c
@@ -6629,8 +6629,14 @@ handle_command_whois (struct app_context *ctx, char *arguments)
struct server *s = ctx->current_buffer->server;
if (*arguments)
irc_send (s, "WHOIS %s", arguments);
+ else if (ctx->current_buffer->type == BUFFER_PM)
+ irc_send (s, "WHOIS %s", ctx->current_buffer->user->nickname);
+ else if (ctx->current_buffer->type == BUFFER_SERVER)
+ irc_send (s, "WHOIS %s", s->irc_user->nickname);
else
- irc_send (s, "WHOIS");
+ buffer_send_error (ctx, ctx->current_buffer,
+ "%s: %s", "Can't request info",
+ "no target given and this buffer is not a PM nor a server");
return true;
}
@@ -6643,8 +6649,12 @@ handle_command_whowas (struct app_context *ctx, char *arguments)
struct server *s = ctx->current_buffer->server;
if (*arguments)
irc_send (s, "WHOWAS %s", arguments);
+ else if (ctx->current_buffer->type == BUFFER_PM)
+ irc_send (s, "WHOWAS %s", ctx->current_buffer->user->nickname);
else
- irc_send (s, "WHOWAS");
+ buffer_send_error (ctx, ctx->current_buffer,
+ "%s: %s", "Can't request info",
+ "no target given and this buffer is not a PM");
return true;
}
@@ -6816,10 +6826,10 @@ g_command_handlers[] =
"[<mask>]",
handle_command_who },
{ "whois", "Get user information",
- "<mask>",
+ "[<target>] <mask>",
handle_command_whois },
{ "whowas", "Get user information",
- "<mask>",
+ "<user> [<count> [<target>]]",
handle_command_whowas },
{ "motd", "Get the Message of The Day",