diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2023-10-25 09:47:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 09:47:21 +0200 |
commit | 4fa8512d576ca2a425e6cc546264934d959bced5 (patch) | |
tree | 7931367c774d168535583ed294c3d05d11fed7d3 /roomserver/state | |
parent | 1b124fe9cba8b4699a1f65382e4ea1a5674d12fa (diff) |
Check event is not rejected (#3243)
Companion PR to https://github.com/matrix-org/gomatrixserverlib/pull/421
Diffstat (limited to 'roomserver/state')
-rw-r--r-- | roomserver/state/state.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/roomserver/state/state.go b/roomserver/state/state.go index 1e776ff6..dfd439a2 100644 --- a/roomserver/state/state.go +++ b/roomserver/state/state.go @@ -45,6 +45,7 @@ type StateResolutionStorage interface { AddState(ctx context.Context, roomNID types.RoomNID, stateBlockNIDs []types.StateBlockNID, state []types.StateEntry) (types.StateSnapshotNID, error) Events(ctx context.Context, roomVersion gomatrixserverlib.RoomVersion, eventNIDs []types.EventNID) ([]types.Event, error) EventsFromIDs(ctx context.Context, roomInfo *types.RoomInfo, eventIDs []string) ([]types.Event, error) + IsEventRejected(ctx context.Context, roomNID types.RoomNID, eventID string) (bool, error) } type StateResolution struct { @@ -1066,6 +1067,13 @@ func (v *StateResolution) resolveConflictsV2( func(roomID spec.RoomID, senderID spec.SenderID) (*spec.UserID, error) { return v.Querier.QueryUserIDForSender(ctx, roomID, senderID) }, + func(eventID string) bool { + isRejected, err := v.db.IsEventRejected(ctx, v.roomInfo.RoomNID, eventID) + if err != nil { + return true + } + return isRejected + }, ) }() |