degesch: fix sending the reason in /part

This commit is contained in:
Přemysl Eric Janouch 2015-05-17 16:23:32 +02:00
parent 87352b33d0
commit 02160c897a
1 changed files with 8 additions and 3 deletions

View File

@ -5205,9 +5205,14 @@ handle_command_part (struct app_context *ctx, char *arguments)
struct server *s = ctx->current_buffer->server; struct server *s = ctx->current_buffer->server;
if (*arguments) if (*arguments)
{
// TODO: check if the arguments are in the form of "channel(,channel)*" // TODO: check if the arguments are in the form of "channel(,channel)*"
// TODO: make sure to send the reason as one argument char *channels = cut_word (&arguments);
irc_send (s, "PART %s", arguments); if (*arguments)
irc_send (s, "PART %s :%s", channels, arguments);
else
irc_send (s, "PART %s", channels);
}
else if (ctx->current_buffer->type != BUFFER_CHANNEL) else if (ctx->current_buffer->type != BUFFER_CHANNEL)
buffer_send_error (ctx, ctx->current_buffer, buffer_send_error (ctx, ctx->current_buffer,
"%s: %s", "Can't part", "%s: %s", "Can't part",
@ -5370,7 +5375,7 @@ g_command_handlers[] =
"[<channel>[,<channel>...]]", "[<channel>[,<channel>...]]",
handle_command_join }, handle_command_join },
{ "part", "Leave channels", { "part", "Leave channels",
"[<channel>[,<channel>...]]", "[<channel>[,<channel>...]] [reason]",
handle_command_part }, handle_command_part },
NOT_IMPLEMENTED (cycle) NOT_IMPLEMENTED (cycle)