Connect to an account on start-up

This commit enables connecting to an account on startup which enables
the use case of having different pre-configured scripts which start
different profanity processes for different accounts. This only makes
sense in the light of not supporting many accounts connected per
process.
This commit is contained in:
Tomás Senart
2013-10-14 21:22:46 +02:00
parent 3cc080b06a
commit ac7ec7f2d1
3 changed files with 11 additions and 3 deletions

View File

@@ -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,12 @@ prof_run(const int disable_tls, char *log_level)
char inp[INP_WIN_MAX];
int size = 0;
if (strlen(account_name) != 0) {
char *cmd = "/connect";
snprintf(inp, sizeof(inp), "%s %s", cmd, account_name);
cmd_execute(cmd, inp);
}
while(cmd_result == TRUE) {
wint_t ch = ERR;
size = 0;