[bugfix] Don't assume "manuallyApprovesFollowers": true if not set

This commit is contained in:
tobi 2025-04-07 13:19:41 +02:00
commit 0977f2a2a4
2 changed files with 3 additions and 3 deletions

View file

@ -520,11 +520,11 @@ func SetDiscoverable(with WithDiscoverable, discoverable bool) {
// GetManuallyApprovesFollowers returns the boolean contained in the ManuallyApprovesFollowers property of 'with'. // GetManuallyApprovesFollowers returns the boolean contained in the ManuallyApprovesFollowers property of 'with'.
// //
// Returns default 'true' if property unusable or not set. // Returns default 'false' if property unusable or not set.
func GetManuallyApprovesFollowers(with WithManuallyApprovesFollowers) bool { func GetManuallyApprovesFollowers(with WithManuallyApprovesFollowers) bool {
mafProp := with.GetActivityStreamsManuallyApprovesFollowers() mafProp := with.GetActivityStreamsManuallyApprovesFollowers()
if mafProp == nil || !mafProp.IsXMLSchemaBoolean() { if mafProp == nil || !mafProp.IsXMLSchemaBoolean() {
return true return false
} }
return mafProp.Get() return mafProp.Get()
} }

View file

@ -154,7 +154,7 @@ func (c *Converter) ASRepresentationToAccount(
// Assume not memorial (todo) // Assume not memorial (todo)
acct.MemorializedAt = time.Time{} acct.MemorializedAt = time.Time{}
// Extract 'manuallyApprovesFollowers' aka locked account (default = true). // Extract 'manuallyApprovesFollowers' aka locked account (default = false).
manuallyApprovesFollowers := ap.GetManuallyApprovesFollowers(accountable) manuallyApprovesFollowers := ap.GetManuallyApprovesFollowers(accountable)
acct.Locked = &manuallyApprovesFollowers acct.Locked = &manuallyApprovesFollowers