aboutsummaryrefslogtreecommitdiff
path: root/cmd/resolve-state
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-04-27 16:35:19 +0100
committerGitHub <noreply@github.com>2023-04-27 16:35:19 +0100
commit617131030707aacd39f0f771626eaa5b8f88299c (patch)
tree41c91962f6235871e5178bae4fd174ef58dffd05 /cmd/resolve-state
parentc6457cd4e551017246af7ddcece212edfb927076 (diff)
Use PDU interface (#3070)
We only use it in a few places currently, enough to get things to compile and run. We should be using it in much more places. Similarly, in some places we cast []PDU back to []*Event, we need to not do that. Likewise, in some places we cast PDU to *Event, we need to not do that. For now though, hopefully this is a start.
Diffstat (limited to 'cmd/resolve-state')
-rw-r--r--cmd/resolve-state/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/resolve-state/main.go b/cmd/resolve-state/main.go
index 09c0e690..b2f4afa8 100644
--- a/cmd/resolve-state/main.go
+++ b/cmd/resolve-state/main.go
@@ -183,8 +183,8 @@ func main() {
var resolved Events
resolved, err = gomatrixserverlib.ResolveConflicts(
gomatrixserverlib.RoomVersion(*roomVersion),
- events,
- authEvents,
+ gomatrixserverlib.ToPDUs(events),
+ gomatrixserverlib.ToPDUs(authEvents),
)
if err != nil {
panic(err)
@@ -208,7 +208,7 @@ func main() {
fmt.Println("Returned", count, "state events after filtering")
}
-type Events []*gomatrixserverlib.Event
+type Events []gomatrixserverlib.PDU
func (e Events) Len() int {
return len(e)