diff --git a/degesch.c b/degesch.c index 6a7e0db..2118a4d 100644 --- a/degesch.c +++ b/degesch.c @@ -1983,6 +1983,10 @@ irc_remove_user_from_channel (struct user *user, struct channel *channel) // --- Supporting code --------------------------------------------------------- +static bool irc_connect (struct server *s, bool *should_retry, struct error **); +static void irc_cancel_timers (struct server *s); +static void on_irc_reconnect_timeout (void *user_data); + static char * irc_cut_nickname (const char *prefix) { @@ -4236,6 +4240,22 @@ handle_command_part (struct app_context *ctx, char *arguments) return true; } +static bool +handle_command_connect (struct app_context *ctx, char *arguments) +{ + // TODO: multiserver + struct server *s = &ctx->server; + if (s->irc_fd != -1) + { + buffer_send_error (ctx, s->buffer, "Already connected"); + return true; + } + + irc_cancel_timers (s); + on_irc_reconnect_timeout (s); + return true; +} + static bool handle_command_list (struct app_context *ctx, char *arguments) { @@ -4283,31 +4303,31 @@ static struct command_handler } g_command_handlers[] = { - { "help", handle_command_help, "Show help", + { "help", handle_command_help, "Show help", "[ |