[bugfix] Fix setting bot on/off (#3986)

* [bugfix] Fix setting bot on/off

* read client messages in tests

* test fix
This commit is contained in:
tobi 2025-04-11 16:36:40 +02:00 committed by GitHub
commit c8a780e12a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 97 additions and 23 deletions

View file

@ -77,8 +77,16 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form
acctColumns = append(acctColumns, "discoverable")
}
if form.Bot != nil {
account.ActorType = gtsmodel.AccountActorTypeService
if bot := form.Bot; bot != nil {
if *bot {
// Mark account as an Application.
// See: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-application
account.ActorType = gtsmodel.AccountActorTypeApplication
} else {
// Mark account as a Person.
// See: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person
account.ActorType = gtsmodel.AccountActorTypePerson
}
acctColumns = append(acctColumns, "actor_type")
}