diff options
Diffstat (limited to 'src/profanity.c')
-rw-r--r-- | src/profanity.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/profanity.c b/src/profanity.c index 06067d93..6bd7e2f0 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -58,7 +58,7 @@ static void _create_directories(void); static gboolean idle = FALSE; void -prof_run(const int disable_tls, char *log_level) +prof_run(const int disable_tls, char *log_level, char *account_name) { _init(disable_tls, log_level); log_info("Starting main event loop"); @@ -70,6 +70,18 @@ prof_run(const int disable_tls, char *log_level) char inp[INP_WIN_MAX]; int size = 0; + ui_refresh(); + + if (account_name != NULL) { + char *cmd = "/connect"; + snprintf(inp, sizeof(inp), "%s %s", cmd, account_name); + _process_input(inp); + } else if (prefs_get_string(PREF_CONNECT_ACCOUNT) != NULL) { + char *cmd = "/connect"; + snprintf(inp, sizeof(inp), "%s %s", cmd, prefs_get_string(PREF_CONNECT_ACCOUNT)); + _process_input(inp); + } + while(cmd_result == TRUE) { wint_t ch = ERR; size = 0; |