mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 18:53:06 -06:00
domain blocking more work
This commit is contained in:
parent
d27791bc73
commit
99eb3bf564
11 changed files with 160 additions and 58 deletions
|
|
@ -2,6 +2,7 @@ package visibility
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"net/url"
|
||||
|
||||
"fmt"
|
||||
|
||||
|
|
@ -16,6 +17,15 @@ func (f *filter) StatusVisible(targetStatus *gtsmodel.Status, requestingAccount
|
|||
"statusID": targetStatus.ID,
|
||||
})
|
||||
|
||||
uri, err := url.Parse(targetStatus.URI)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("StatusVisible: error parsing uri: %s", targetStatus.URI)
|
||||
}
|
||||
if blocked, err := f.blockedDomain(uri.Host); blocked || err != nil {
|
||||
l.Debugf("domain %s is blocked", uri.Host)
|
||||
return blocked, err
|
||||
}
|
||||
aaaaaaaaaa
|
||||
relevantAccounts, err := f.pullRelevantAccountsFromStatus(targetStatus)
|
||||
if err != nil {
|
||||
l.Debugf("error pulling relevant accounts for status %s: %s", targetStatus.ID, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue