2023-03-12 16:00:57 +01:00
|
|
|
// 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/>.
|
2021-08-25 15:34:33 +02:00
|
|
|
|
2021-06-13 18:42:28 +02:00
|
|
|
package status
|
|
|
|
|
|
|
|
import (
|
2023-05-12 11:15:54 +02:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
2024-07-24 13:27:42 +02:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
2024-02-27 13:22:05 +01:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
2021-06-13 18:42:28 +02:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
2023-10-25 16:04:53 +02:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/processing/common"
|
2023-11-08 15:32:17 +01:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/processing/polls"
|
2023-03-01 19:26:53 +01:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/state"
|
2021-07-26 20:25:54 +02:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/text"
|
2021-06-13 18:42:28 +02:00
|
|
|
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
|
|
|
)
|
|
|
|
|
2023-02-22 16:05:26 +01:00
|
|
|
type Processor struct {
|
2023-11-08 15:32:17 +01:00
|
|
|
// embedded common logic
|
2023-10-25 16:04:53 +02:00
|
|
|
c *common.Processor
|
|
|
|
|
2023-03-01 19:26:53 +01:00
|
|
|
state *state.State
|
2023-10-23 11:58:13 +02:00
|
|
|
federator *federation.Federator
|
2023-09-23 18:44:11 +02:00
|
|
|
converter *typeutils.Converter
|
2024-07-24 13:27:42 +02:00
|
|
|
visFilter *visibility.Filter
|
|
|
|
intFilter *interaction.Filter
|
2023-09-29 10:39:56 +02:00
|
|
|
formatter *text.Formatter
|
2022-04-28 14:23:11 +02:00
|
|
|
parseMention gtsmodel.ParseMentionFunc
|
2023-11-08 15:32:17 +01:00
|
|
|
|
|
|
|
// other processors
|
|
|
|
polls *polls.Processor
|
2021-06-13 18:42:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// New returns a new status processor.
|
2023-10-25 16:04:53 +02:00
|
|
|
func New(
|
|
|
|
state *state.State,
|
2023-11-08 15:32:17 +01:00
|
|
|
common *common.Processor,
|
|
|
|
polls *polls.Processor,
|
2023-10-25 16:04:53 +02:00
|
|
|
federator *federation.Federator,
|
|
|
|
converter *typeutils.Converter,
|
2024-07-24 13:27:42 +02:00
|
|
|
visFilter *visibility.Filter,
|
|
|
|
intFilter *interaction.Filter,
|
2023-10-25 16:04:53 +02:00
|
|
|
parseMention gtsmodel.ParseMentionFunc,
|
|
|
|
) Processor {
|
2023-02-22 16:05:26 +01:00
|
|
|
return Processor{
|
2023-10-25 16:04:53 +02:00
|
|
|
c: common,
|
2023-03-01 19:26:53 +01:00
|
|
|
state: state,
|
2023-05-12 11:15:54 +02:00
|
|
|
federator: federator,
|
2023-09-23 18:44:11 +02:00
|
|
|
converter: converter,
|
2024-07-24 13:27:42 +02:00
|
|
|
visFilter: visFilter,
|
|
|
|
intFilter: intFilter,
|
2023-03-01 19:26:53 +01:00
|
|
|
formatter: text.NewFormatter(state.DB),
|
2022-04-28 14:23:11 +02:00
|
|
|
parseMention: parseMention,
|
2023-11-08 15:32:17 +01:00
|
|
|
polls: polls,
|
2021-06-13 18:42:28 +02:00
|
|
|
}
|
|
|
|
}
|