forked from mirrors/gotosocial
Hack: Allow for me specifically to migrate to GoToSocial
This commit is contained in:
parent
0ddc2edf19
commit
af29c06290
1 changed files with 9 additions and 0 deletions
|
@ -121,6 +121,15 @@ func (p *Processor) UserGet(ctx context.Context, requestedUsername string, reque
|
|||
|
||||
func data(requestedPerson vocab.ActivityStreamsPerson) (interface{}, gtserror.WithCode) {
|
||||
data, err := ap.Serialize(requestedPerson)
|
||||
|
||||
// Convert the preferredUsername to string and check if it is equal to "rafaelcaricio"
|
||||
if err == nil && data != nil && data["preferredUsername"] != nil {
|
||||
if preferredUsername, ok := data["preferredUsername"].(string); ok && preferredUsername == "rafaelcaricio" {
|
||||
// add a new field to data "alsoKnownAs" which is an array of strings
|
||||
data["alsoKnownAs"] = []string{"https://fosstodon.org/users/rafaelcaricio"}
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
err := gtserror.Newf("error serializing person: %w", err)
|
||||
return nil, gtserror.NewErrorInternalError(err)
|
||||
|
|
Loading…
Reference in a new issue