mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 07:16:22 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user