Allow clearing account resource

issue #880
This commit is contained in:
James Booth
2016-11-22 00:39:52 +00:00
parent c441dbfa42
commit e043029a50
17 changed files with 75 additions and 40 deletions

View File

@@ -64,9 +64,13 @@ cl_ev_connect_jid(const char *const jid, const char *const passwd, const char *c
jabber_conn_status_t
cl_ev_connect_account(ProfAccount *account)
{
char *jid = account_create_full_jid(account);
cons_show("Connecting with account %s as %s", account->name, jid);
free(jid);
if (account->resource) {
cons_show("Connecting with account %s as %s/%s", account->name, account->jid, account->resource);
} else if (g_strcmp0(account->name, account->jid) == 0) {
cons_show("Connecting with account %s", account->name);
} else {
cons_show("Connecting with account %s as %s", account->name, account->jid);
}
return session_connect_with_account(account);
}
@@ -75,7 +79,9 @@ void
cl_ev_disconnect(void)
{
const char *jid = connection_get_fulljid();
cons_show("%s logged out successfully.", jid);
Jid *jidp = jid_create(jid);
cons_show("%s logged out successfully.", jidp->barejid);
jid_destroy(jidp);
ui_disconnected();
ui_close_all_wins();