From e97ec56fce641554ff7aa2ff9f0583e1fb9fc364 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 9 Apr 2014 22:29:38 +0100 Subject: Added ui_already_connected --- src/command/commands.c | 2 +- src/ui/core.c | 7 +++++++ src/ui/ui.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/command/commands.c b/src/command/commands.c index a7deb17a..2dcb4a0e 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -65,7 +65,7 @@ cmd_connect(gchar **args, struct cmd_help_t help) jabber_conn_status_t conn_status = jabber_get_connection_status(); if ((conn_status != JABBER_DISCONNECTED) && (conn_status != JABBER_STARTED)) { - cons_show("You are either connected already, or a login is in process."); + ui_already_connected(); result = TRUE; } else { char *user = args[0]; diff --git a/src/ui/core.c b/src/ui/core.c index 3cb05fe8..b3b4eadb 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -544,6 +544,12 @@ _ui_unknown_command(const char * const input) cons_show("Unknown command: %s", input); } +static void +_ui_already_connected(void) +{ + cons_show("You are either connected already, or a login is in process."); +} + static void _ui_disconnected(void) { @@ -1922,4 +1928,5 @@ ui_init_module(void) ui_replace_input = _ui_replace_input; ui_invalid_command_usage = _ui_invalid_command_usage; ui_unknown_command = _ui_unknown_command; + ui_already_connected = _ui_already_connected; } diff --git a/src/ui/ui.h b/src/ui/ui.h index fc689305..7543e6a8 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -161,6 +161,7 @@ void (*ui_replace_input)(char *input, const char * const new_input, int *size); void (*ui_invalid_command_usage)(const char * const usage, void (**setting_func)(void)); void (*ui_unknown_command)(const char * const input); +void (*ui_already_connected)(void); // console window actions void (*cons_show)(const char * const msg, ...); -- cgit 1.4.1-2-gfad0