diff options
author | 2024-05-06 04:49:08 -0700 | |
---|---|---|
committer | 2024-05-06 12:49:08 +0100 | |
commit | 45f4afe60e29e147e3adfaa4d7b66ca58e22b1de (patch) | |
tree | 85b14b05516274f504c7237540f8c8fb3b9ae68e /internal/api/model/filterresult.go | |
parent | [chore]: Bump golang.org/x/oauth2 from 0.19.0 to 0.20.0 (#2900) (diff) | |
download | gotosocial-45f4afe60e29e147e3adfaa4d7b66ca58e22b1de.tar.xz |
feature: filters v2 server-side warning/hiding (#2793)
* Remove dead code
* Filter statuses when converting to frontend representation
* status.filtered is an array
* Make matching case-insensitive
* Remove TODOs that don't need to be done now
* Add missing filter check for notification
* lint: rename ErrHideStatus
* APIFilterActionToFilterAction not used yet
* swaggerino docseroni
* Address review comments
* Add apimodel.FilterActionNone
---------
Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/api/model/filterresult.go')
-rw-r--r-- | internal/api/model/filterresult.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/api/model/filterresult.go b/internal/api/model/filterresult.go new file mode 100644 index 000000000..942c2124a --- /dev/null +++ b/internal/api/model/filterresult.go @@ -0,0 +1,34 @@ +// GoToSocial +// Copyright (C) GoToSocial Authors admin@gotosocial.org +// SPDX-License-Identifier: AGPL-3.0-or-later +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +package model + +// FilterResult is returned along with a filtered status to explain why it was filtered. +// +// swagger:model filterResult +// +// --- +// tags: +// - filters +type FilterResult struct { + // The filter that was matched. + Filter FilterV2 `json:"filter"` + // The keywords within the filter that were matched. + KeywordMatches []string `json:"keyword_matches"` + // The status IDs within the filter that were matched. + StatusMatches []string `json:"status_matches"` +} |