degesch: fix /whois, /whowas
This commit is contained in:
parent
088009d16b
commit
bdad7bd7c2
18
degesch.c
18
degesch.c
|
@ -6629,8 +6629,14 @@ handle_command_whois (struct app_context *ctx, char *arguments)
|
||||||
struct server *s = ctx->current_buffer->server;
|
struct server *s = ctx->current_buffer->server;
|
||||||
if (*arguments)
|
if (*arguments)
|
||||||
irc_send (s, "WHOIS %s", 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
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6643,8 +6649,12 @@ handle_command_whowas (struct app_context *ctx, char *arguments)
|
||||||
struct server *s = ctx->current_buffer->server;
|
struct server *s = ctx->current_buffer->server;
|
||||||
if (*arguments)
|
if (*arguments)
|
||||||
irc_send (s, "WHOWAS %s", 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
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6816,10 +6826,10 @@ g_command_handlers[] =
|
||||||
"[<mask>]",
|
"[<mask>]",
|
||||||
handle_command_who },
|
handle_command_who },
|
||||||
{ "whois", "Get user information",
|
{ "whois", "Get user information",
|
||||||
"<mask>",
|
"[<target>] <mask>",
|
||||||
handle_command_whois },
|
handle_command_whois },
|
||||||
{ "whowas", "Get user information",
|
{ "whowas", "Get user information",
|
||||||
"<mask>",
|
"<user> [<count> [<target>]]",
|
||||||
handle_command_whowas },
|
handle_command_whowas },
|
||||||
|
|
||||||
{ "motd", "Get the Message of The Day",
|
{ "motd", "Get the Message of The Day",
|
||||||
|
|
Loading…
Reference in New Issue