mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 14:32:25 -05:00
[chore] Add interaction filter to complement existing visibility filter (#3111)
* [chore] Add interaction filter to complement existing visibility filter
* pass in ptr to visibility and interaction filters to Processor{} to ensure shared
* use int constants for for match type, cache db calls in filterctx
* function name typo 😇
---------
Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
63fc9b6c3e
commit
c9b6220fef
61 changed files with 1661 additions and 585 deletions
|
|
@ -341,7 +341,7 @@ func (p *Processor) ContextGet(
|
|||
// Convert ancestors + filter
|
||||
// out ones that aren't visible.
|
||||
for _, status := range threadContext.ancestors {
|
||||
if v, err := p.filter.StatusVisible(ctx, requester, status); err == nil && v {
|
||||
if v, err := p.visFilter.StatusVisible(ctx, requester, status); err == nil && v {
|
||||
status, err := convert(ctx, status, requester)
|
||||
if err == nil {
|
||||
apiContext.Ancestors = append(apiContext.Ancestors, *status)
|
||||
|
|
@ -352,7 +352,7 @@ func (p *Processor) ContextGet(
|
|||
// Convert descendants + filter
|
||||
// out ones that aren't visible.
|
||||
for _, status := range threadContext.descendants {
|
||||
if v, err := p.filter.StatusVisible(ctx, requester, status); err == nil && v {
|
||||
if v, err := p.visFilter.StatusVisible(ctx, requester, status); err == nil && v {
|
||||
status, err := convert(ctx, status, requester)
|
||||
if err == nil {
|
||||
apiContext.Descendants = append(apiContext.Descendants, *status)
|
||||
|
|
@ -453,7 +453,7 @@ func (p *Processor) WebContextGet(
|
|||
// Ensure status is actually
|
||||
// visible to just anyone, and
|
||||
// hide / don't include it if not.
|
||||
v, err := p.filter.StatusVisible(ctx, nil, status)
|
||||
v, err := p.visFilter.StatusVisible(ctx, nil, status)
|
||||
if err != nil || !v {
|
||||
if !inReplies {
|
||||
// Main thread entry hidden.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue