mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Check event is not rejected (#3243)
Companion PR to https://github.com/matrix-org/gomatrixserverlib/pull/421
This commit is contained in:
parent
1b124fe9cb
commit
4fa8512d57
7 changed files with 49 additions and 3 deletions
|
@ -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
|
||||
},
|
||||
)
|
||||
}()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue