aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-10-25 09:47:21 +0200
committerGitHub <noreply@github.com>2023-10-25 09:47:21 +0200
commit4fa8512d576ca2a425e6cc546264934d959bced5 (patch)
tree7931367c774d168535583ed294c3d05d11fed7d3 /cmd
parent1b124fe9cba8b4699a1f65382e4ea1a5674d12fa (diff)
Check event is not rejected (#3243)
Companion PR to https://github.com/matrix-org/gomatrixserverlib/pull/421
Diffstat (limited to 'cmd')
-rw-r--r--cmd/resolve-state/main.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/resolve-state/main.go b/cmd/resolve-state/main.go
index 5be44909..d6db7243 100644
--- a/cmd/resolve-state/main.go
+++ b/cmd/resolve-state/main.go
@@ -202,12 +202,25 @@ func main() {
authEvents[i] = authEventEntries[i].PDU
}
+ // Get the roomNID
+ roomInfo, err = roomserverDB.RoomInfo(ctx, authEvents[0].RoomID().String())
+ if err != nil {
+ panic(err)
+ }
+
fmt.Println("Resolving state")
var resolved Events
resolved, err = gomatrixserverlib.ResolveConflicts(
gomatrixserverlib.RoomVersion(*roomVersion), events, authEvents, func(roomID spec.RoomID, senderID spec.SenderID) (*spec.UserID, error) {
return rsAPI.QueryUserIDForSender(ctx, roomID, senderID)
},
+ func(eventID string) bool {
+ isRejected, rejectedErr := roomserverDB.IsEventRejected(ctx, roomInfo.RoomNID, eventID)
+ if rejectedErr != nil {
+ return true
+ }
+ return isRejected
+ },
)
if err != nil {
panic(err)