From 7853231ea1b620d8eaa75f1bc3eda5ec459e296d Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Thu, 12 Jan 2023 21:38:45 +0000 Subject: [PATCH] Set user.FullName before creating user --- routers/api/v1/activitypub/create.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/api/v1/activitypub/create.go b/routers/api/v1/activitypub/create.go index a58f775497..abf5ff402f 100644 --- a/routers/api/v1/activitypub/create.go +++ b/routers/api/v1/activitypub/create.go @@ -87,14 +87,14 @@ func createPerson(ctx context.Context, person *ap.Person) error { LoginName: person.GetLink().String(), EmailNotificationsPreference: user_model.EmailNotificationsDisabled, } + if person.Name != nil { + user.FullName = person.Name.String() + } err = user_model.CreateUser(user) if err != nil { return err } - - if person.Name != nil { - user.FullName = person.Name.String() - } + if person.Icon != nil { // Fetch and save user icon icon, err := ap.ToObject(person.Icon)