mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 04:37:30 -06:00
[bugfix] Filter fixes (#2971)
* Add Filter.Expired convenience method, consistent with mutes * Add missing Swagger for filter keyword/status delete and for 403s on moved accounts
This commit is contained in:
parent
5e2d4fdb19
commit
e605788b4b
12 changed files with 165 additions and 2 deletions
|
|
@ -40,6 +40,12 @@ type Filter struct {
|
|||
ContextAccount *bool `bun:",nullzero,notnull,default:false"` // Apply filter when viewing an account profile.
|
||||
}
|
||||
|
||||
// Expired returns whether the filter has expired at a given time.
|
||||
// Filters without an expiration timestamp never expire.
|
||||
func (f *Filter) Expired(now time.Time) bool {
|
||||
return !f.ExpiresAt.IsZero() && !f.ExpiresAt.After(now)
|
||||
}
|
||||
|
||||
// FilterKeyword stores a single keyword to filter statuses against.
|
||||
type FilterKeyword struct {
|
||||
ID string `bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue