Add event reporting (#3340)

Part of #3216 and #3226 

There will be a follow up PR which is going to add the same admin
endpoints Synapse has, so existing tools also work for Dendrite.
This commit is contained in:
Till 2024-03-21 19:27:34 +01:00 committed by GitHub
parent de95499178
commit b9abbf7b20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 474 additions and 1 deletions

View file

@ -30,6 +30,7 @@ import (
type Database interface {
UserRoomKeys
ReportedEvents
// Do we support processing input events for more than one room at a time?
SupportsConcurrentRoomInputs() bool
AssignRoomNID(ctx context.Context, roomID spec.RoomID, roomVersion gomatrixserverlib.RoomVersion) (roomNID types.RoomNID, err error)
@ -257,3 +258,11 @@ type EventDatabase interface {
) (gomatrixserverlib.PDU, gomatrixserverlib.PDU, error)
StoreEvent(ctx context.Context, event gomatrixserverlib.PDU, roomInfo *types.RoomInfo, eventTypeNID types.EventTypeNID, eventStateKeyNID types.EventStateKeyNID, authEventNIDs []types.EventNID, isRejected bool) (types.EventNID, types.StateAtEvent, error)
}
type ReportedEvents interface {
InsertReportedEvent(
ctx context.Context,
roomID, eventID, reportingUserID, reason string,
score int64,
) (int64, error)
}