degesch: fix /mode after breaking it
The clean up was a bit thoughtless.
This commit is contained in:
parent
27ef5c2ea3
commit
088009d16b
10
degesch.c
10
degesch.c
|
@ -6326,17 +6326,19 @@ handle_command_mode (struct app_context *ctx, char *arguments)
|
||||||
// Channel names prefixed by "+" collide with mode strings,
|
// Channel names prefixed by "+" collide with mode strings,
|
||||||
// so we just disallow specifying these channels
|
// so we just disallow specifying these channels
|
||||||
char *target = NULL;
|
char *target = NULL;
|
||||||
if (strchr ("+-\0", *arguments)
|
if (strchr ("+-\0", *arguments))
|
||||||
|| !(target = maybe_cut_word (&arguments, validate_channel_name, s))
|
|
||||||
|| !(target = cut_word (&arguments)))
|
|
||||||
{
|
{
|
||||||
if (ctx->current_buffer->type == BUFFER_CHANNEL)
|
if (ctx->current_buffer->type == BUFFER_CHANNEL)
|
||||||
target = ctx->current_buffer->channel->name;
|
target = ctx->current_buffer->channel->name;
|
||||||
if (ctx->current_buffer->type == BUFFER_PM)
|
if (ctx->current_buffer->type == BUFFER_PM)
|
||||||
target = ctx->current_buffer->user->nickname;
|
target = ctx->current_buffer->user->nickname;
|
||||||
if (ctx->current_buffer->type == BUFFER_SERVER)
|
if (ctx->current_buffer->type == BUFFER_SERVER)
|
||||||
target = ctx->current_buffer->server->irc_user->nickname;
|
target = s->irc_user->nickname;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
// If there arguments and they don't begin with a mode string,
|
||||||
|
// they're either a user name or a channel name
|
||||||
|
target = cut_word (&arguments);
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
buffer_send_error (ctx, ctx->current_buffer,
|
buffer_send_error (ctx, ctx->current_buffer,
|
||||||
|
|
Loading…
Reference in New Issue