From 540edef0c20dad4ea13d8af091ccf69796b848b6 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Mon, 9 Sep 2024 15:56:58 -0700 Subject: [feature] Implement exclusive lists (#3280) Fixes #2616 --- internal/processing/list/update.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/processing/list/update.go') diff --git a/internal/processing/list/update.go b/internal/processing/list/update.go index 656af1f78..408c334de 100644 --- a/internal/processing/list/update.go +++ b/internal/processing/list/update.go @@ -36,6 +36,7 @@ func (p *Processor) Update( id string, title *string, repliesPolicy *gtsmodel.RepliesPolicy, + exclusive *bool, ) (*apimodel.List, gtserror.WithCode) { list, errWithCode := p.getList( // Use barebones ctx; no embedded @@ -49,7 +50,7 @@ func (p *Processor) Update( } // Only update columns we're told to update. - columns := make([]string, 0, 2) + columns := make([]string, 0, 3) if title != nil { list.Title = *title @@ -61,6 +62,11 @@ func (p *Processor) Update( columns = append(columns, "replies_policy") } + if exclusive != nil { + list.Exclusive = exclusive + columns = append(columns, "exclusive") + } + if err := p.state.DB.UpdateList(ctx, list, columns...); err != nil { if errors.Is(err, db.ErrAlreadyExists) { err = errors.New("you already have a list with this title") -- cgit v1.2.3