Use username if display name is blank (#11)

This commit is contained in:
Daniel J. Summers 2021-02-01 20:12:41 -05:00
parent a5c88a1034
commit 7c6804c2af

View File

@ -80,6 +80,13 @@ namespace JobsJobsJobs.Server
$"Profiles must be from noagendasocial.com; yours is {profileResponse.AccountName}"); $"Profiles must be from noagendasocial.com; yours is {profileResponse.AccountName}");
} }
// If the user hasn't filled in a display name, use the username as the display name.
// (this is what Mastodon does)
if (string.IsNullOrWhiteSpace(profileResponse.DisplayName))
{
profileResponse.DisplayName = profileResponse.Username;
}
return Result<MastodonAccount>.AsOk(profileResponse); return Result<MastodonAccount>.AsOk(profileResponse);
} }