Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
John Brooks committed Feb 20, 2013
1 parent 7cc6ecf commit 4ee5233
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 0 additions & 3 deletions telepathy-sasl-signon/empathy-sasl-mechanisms.c
Expand Up @@ -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 },

Expand Down
7 changes: 7 additions & 0 deletions telepathy-sasl-signon/empathy-uoa-auth-handler.c
Expand Up @@ -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),
Expand Down

0 comments on commit 4ee5233

Please sign in to comment.