1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Added cons output when logging in.

Fixed issue with creating a new account on reconnect
This commit is contained in:
James Booth 2013-01-27 02:24:02 +00:00
parent 235339e5a5
commit 20d0df4c34
2 changed files with 10 additions and 13 deletions

View File

@ -1011,22 +1011,24 @@ _cmd_connect(gchar **args, struct cmd_help_t help)
ProfAccount *account = accounts_get_account(lower);
if (account != NULL) {
jid = strdup(account->jid);
log_debug("Connecting as %s", jid);
if (account->resource != NULL) {
jid = create_fulljid(account->jid, account->resource);
} else {
jid = strdup(account->jid);
}
cons_show("Connecting with account %s as %s", account->name, jid);
log_debug("Connecting with account %s as %s", account->name, jid);
conn_status = jabber_connect_with_account(account, passwd);
} else {
jid = strdup(lower);
cons_show("Connecting as %s", jid);
log_debug("Connecting as %s", jid);
conn_status = jabber_connect(jid, passwd, altdomain);
}
if (conn_status == JABBER_CONNECTING) {
cons_show("Connecting...");
log_debug("Connecting...");
}
if (conn_status == JABBER_DISCONNECTED) {
cons_bad_show("Connection to server failed.");
log_debug("Connection for %s failed", jid);
cons_bad_show("Connection attempt for %s failed.", jid);
log_debug("Connection attempt for %s failed", jid);
}
accounts_free_account(account);

View File

@ -130,11 +130,6 @@ jabber_conn_status_t
jabber_connect(const char * const jid,
const char * const passwd, const char * const altdomain)
{
if (saved_user.account != NULL) {
free(saved_user.account);
saved_user.account = NULL;
}
if (saved_user.jid == NULL) {
saved_user.jid = strdup(jid);
}