mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-25 22:23:32 -06:00
[bugfix] Fix set obfuscate = null error in adoptPerm (#3922)
* [chore] More tests for domain allow + block subscriptions * [bugfix] Fix set `obfuscate = null` error in adoptPerm * fmt
This commit is contained in:
parent
f94da1a33c
commit
b6e56feeda
3 changed files with 175 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ package subscriptions
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"cmp"
|
||||
"context"
|
||||
"encoding/csv"
|
||||
"encoding/json"
|
||||
|
|
@ -869,10 +870,13 @@ func (s *Subscriptions) adoptPerm(
|
|||
perm.SetCreatedByAccount(permSub.CreatedByAccount)
|
||||
|
||||
// Set new metadata on the perm.
|
||||
perm.SetObfuscate(obfuscate)
|
||||
perm.SetPrivateComment(privateComment)
|
||||
perm.SetPublicComment(publicComment)
|
||||
|
||||
// Avoid trying to blat nil into the db directly by
|
||||
// defaulting to false if not set on wanted perm.
|
||||
perm.SetObfuscate(cmp.Or(obfuscate, util.Ptr(false)))
|
||||
|
||||
// Update the perm in the db.
|
||||
var err error
|
||||
switch p := perm.(type) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue