mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Moved fulljid logic to accounts
This commit is contained in:
parent
9b631cf571
commit
5e739cbfb7
@ -72,12 +72,7 @@ cmd_connect(gchar **args, struct cmd_help_t help)
|
|||||||
|
|
||||||
ProfAccount *account = accounts_get_account(lower);
|
ProfAccount *account = accounts_get_account(lower);
|
||||||
if (account != NULL) {
|
if (account != NULL) {
|
||||||
if (account->resource != NULL) {
|
jid = accounts_create_full_jid(account);
|
||||||
jid = create_fulljid(account->jid, account->resource);
|
|
||||||
} else {
|
|
||||||
jid = strdup(account->jid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (account->password == NULL) {
|
if (account->password == NULL) {
|
||||||
account->password = ui_ask_password();
|
account->password = ui_ask_password();
|
||||||
}
|
}
|
||||||
|
@ -292,6 +292,16 @@ accounts_get_account(const char * const name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
accounts_create_full_jid(ProfAccount *account)
|
||||||
|
{
|
||||||
|
if (account->resource != NULL) {
|
||||||
|
return create_fulljid(account->jid, account->resource);
|
||||||
|
} else {
|
||||||
|
return strdup(account->jid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
accounts_free_account(ProfAccount *account)
|
accounts_free_account(ProfAccount *account)
|
||||||
{
|
{
|
||||||
|
@ -81,5 +81,6 @@ void accounts_set_priority_all(const char * const account_name, const gint value
|
|||||||
gint accounts_get_priority_for_presence_type(const char * const account_name,
|
gint accounts_get_priority_for_presence_type(const char * const account_name,
|
||||||
resource_presence_t presence_type);
|
resource_presence_t presence_type);
|
||||||
void accounts_clear_password(const char * const account_name);
|
void accounts_clear_password(const char * const account_name);
|
||||||
|
char * accounts_create_full_jid(ProfAccount *account);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -110,4 +110,8 @@ gint accounts_get_priority_for_presence_type(const char * const account_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void accounts_clear_password(const char * const account_name) {}
|
void accounts_clear_password(const char * const account_name) {}
|
||||||
|
char * accounts_create_full_jid(ProfAccount *account)
|
||||||
|
{
|
||||||
|
return (char *)mock();
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user