mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 21:12:25 -05:00
[feature] Add experimental instance-federation-spam-filter option (#2685)
* [chore] Move `visibility` to `filter/visibility` * [feature] Add experimental instance-federation-spam-filter option
This commit is contained in:
parent
87e8cca3ae
commit
9cadc764b3
80 changed files with 1638 additions and 137 deletions
|
|
@ -33,6 +33,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/text"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/util"
|
||||
)
|
||||
|
||||
// ExtractObjects will extract object vocab.Types from given implementing interface.
|
||||
|
|
@ -776,11 +777,21 @@ func extractHashtag(i Hashtaggable) (*gtsmodel.Tag, error) {
|
|||
}
|
||||
tagName := strings.TrimPrefix(name, "#")
|
||||
|
||||
yeah := func() *bool { t := true; return &t }
|
||||
// Extract href for the tag, if set.
|
||||
//
|
||||
// Fine if not, it's only used for spam
|
||||
// checking anyway so not critical.
|
||||
var href string
|
||||
hrefProp := i.GetActivityStreamsHref()
|
||||
if hrefProp != nil && hrefProp.IsIRI() {
|
||||
href = hrefProp.GetIRI().String()
|
||||
}
|
||||
|
||||
return >smodel.Tag{
|
||||
Name: tagName,
|
||||
Useable: yeah(), // Assume true by default.
|
||||
Listable: yeah(), // Assume true by default.
|
||||
Useable: util.Ptr(true), // Assume true by default.
|
||||
Listable: util.Ptr(true), // Assume true by default.
|
||||
Href: href,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue