diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2023-03-01 17:06:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-01 17:06:47 +0100 |
commit | 6c20f8f742a7e03710fae81df6ef98bac31da2b1 (patch) | |
tree | 202e962951dc41c949a71c7f5c1deb6d1da78843 /cmd | |
parent | 1aa70b0f56825a4a5f92c38cabb1fe841cec6e18 (diff) |
Refactor `StoreEvent`, add `MaybeRedactEvent`, create an `EventDatabase` (#2989)
This PR changes the following:
- `StoreEvent` now only stores an event (and possibly prev event),
instead of also doing redactions
- Adds a `MaybeRedactEvent` (pulled out from `StoreEvent`), which should
be called after storing events
- a few other things
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/resolve-state/main.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd/resolve-state/main.go b/cmd/resolve-state/main.go index e3840bbc..a9cc80cb 100644 --- a/cmd/resolve-state/main.go +++ b/cmd/resolve-state/main.go @@ -62,9 +62,10 @@ func main() { panic(err) } - stateres := state.NewStateResolution(roomserverDB, &types.RoomInfo{ + roomInfo := &types.RoomInfo{ RoomVersion: gomatrixserverlib.RoomVersion(*roomVersion), - }) + } + stateres := state.NewStateResolution(roomserverDB, roomInfo) if *difference { if len(snapshotNIDs) != 2 { @@ -87,7 +88,7 @@ func main() { } var eventEntries []types.Event - eventEntries, err = roomserverDB.Events(ctx, 0, eventNIDs) + eventEntries, err = roomserverDB.Events(ctx, roomInfo, eventNIDs) if err != nil { panic(err) } @@ -145,7 +146,7 @@ func main() { } fmt.Println("Fetching", len(eventNIDMap), "state events") - eventEntries, err := roomserverDB.Events(ctx, 0, eventNIDs) + eventEntries, err := roomserverDB.Events(ctx, roomInfo, eventNIDs) if err != nil { panic(err) } @@ -165,7 +166,7 @@ func main() { } fmt.Println("Fetching", len(authEventIDs), "auth events") - authEventEntries, err := roomserverDB.EventsFromIDs(ctx, 0, authEventIDs) + authEventEntries, err := roomserverDB.EventsFromIDs(ctx, roomInfo, authEventIDs) if err != nil { panic(err) } |