aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
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)