mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 19:31:05 +00:00
* Filter empty username strings from Mastodon (fixes #2886) * add issue link
This commit is contained in:
parent
dc9ca5768b
commit
7248c4a6f4
1 changed files with 5 additions and 1 deletions
|
@ -144,9 +144,13 @@ impl Object for ApubPerson {
|
||||||
) -> Result<ApubPerson, LemmyError> {
|
) -> Result<ApubPerson, LemmyError> {
|
||||||
let instance_id = fetch_instance_actor_for_object(&person.id, context).await?;
|
let instance_id = fetch_instance_actor_for_object(&person.id, context).await?;
|
||||||
|
|
||||||
|
// Some Mastodon users have `name: ""` (empty string), need to convert that to `None`
|
||||||
|
// https://github.com/mastodon/mastodon/issues/25233
|
||||||
|
let display_name = person.name.filter(|n| !n.is_empty());
|
||||||
|
|
||||||
let person_form = PersonInsertForm {
|
let person_form = PersonInsertForm {
|
||||||
name: person.preferred_username,
|
name: person.preferred_username,
|
||||||
display_name: person.name,
|
display_name,
|
||||||
banned: None,
|
banned: None,
|
||||||
ban_expires: None,
|
ban_expires: None,
|
||||||
deleted: Some(false),
|
deleted: Some(false),
|
||||||
|
|
Loading…
Reference in a new issue