Use passwords from the accounts file
This commit makes it so that if the password in an account in the accounts file is present, then use it. Otherwise ask for the password to the user.
This commit is contained in:
@@ -109,21 +109,20 @@ jabber_init(const int disable_tls)
|
||||
}
|
||||
|
||||
jabber_conn_status_t
|
||||
jabber_connect_with_account(const ProfAccount * const account,
|
||||
const char * const passwd)
|
||||
jabber_connect_with_account(const ProfAccount * const account)
|
||||
{
|
||||
assert(account != NULL);
|
||||
assert(passwd != NULL);
|
||||
|
||||
log_info("Connecting using account: %s", account->name);
|
||||
|
||||
// save account name and password for reconnect
|
||||
saved_account.name = strdup(account->name);
|
||||
saved_account.passwd = strdup(passwd);
|
||||
saved_account.passwd = strdup(account->password);
|
||||
|
||||
// connect with fulljid
|
||||
Jid *jidp = jid_create_from_bare_and_resource(account->jid, account->resource);
|
||||
jabber_conn_status_t result = _jabber_connect(jidp->fulljid, passwd, account->server);
|
||||
jabber_conn_status_t result =
|
||||
_jabber_connect(jidp->fulljid, account->password, account->server);
|
||||
jid_destroy(jidp);
|
||||
|
||||
return result;
|
||||
|
||||
@@ -78,8 +78,7 @@ typedef struct disco_identity_t {
|
||||
void jabber_init(const int disable_tls);
|
||||
jabber_conn_status_t jabber_connect_with_details(const char * const jid,
|
||||
const char * const passwd, const char * const altdomain);
|
||||
jabber_conn_status_t jabber_connect_with_account(const ProfAccount * const account,
|
||||
const char * const passwd);
|
||||
jabber_conn_status_t jabber_connect_with_account(const ProfAccount * const account);
|
||||
void jabber_disconnect(void);
|
||||
void jabber_shutdown(void);
|
||||
void jabber_process_events(void);
|
||||
|
||||
Reference in New Issue
Block a user