Commit 4ee52336 authored by John Brooks's avatar John Brooks

Fall back to the account display name if signon username isn't available

This is the last piece necessary for oauth support with our stack, so
oauth is re-enabled as well.
parent 7cc6ecf2
......@@ -38,9 +38,6 @@ typedef struct
static SupportedMech supported_mechanisms[] = {
{ EMPATHY_SASL_MECHANISM_FACEBOOK, MECH_FACEBOOK },
/* XXX: Prefer password authentication over OAUTH for now,
* pending infrastructure support for oauth accounts. */
{ EMPATHY_SASL_MECHANISM_PASSWORD, MECH_PASSWORD },
{ EMPATHY_SASL_MECHANISM_WLM, MECH_WLM },
{ EMPATHY_SASL_MECHANISM_GOOGLE, MECH_GOOGLE },
......
......@@ -272,6 +272,13 @@ identity_query_info_cb (SignonIdentity *identity,
}
ctx->username = g_strdup (signon_identity_info_get_username (info));
if (!ctx->username || !*ctx->username)
{
g_free(ctx->username);
AgAccount *account = ag_account_service_get_account (ctx->service);
ctx->username = g_strdup (ag_account_get_display_name (account));
DEBUG ("No username in signon data, falling back to account display name (%s) as username", ctx->username);
}
signon_auth_session_process (ctx->session,
ag_auth_data_get_parameters (ctx->auth_data),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment