aboutsummaryrefslogtreecommitdiff
path: root/federationapi/internal
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 /federationapi/internal
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 'federationapi/internal')
-rw-r--r--federationapi/internal/perform.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/federationapi/internal/perform.go b/federationapi/internal/perform.go
index 8882b5c1..fccea866 100644
--- a/federationapi/internal/perform.go
+++ b/federationapi/internal/perform.go
@@ -634,13 +634,13 @@ func federatedEventProvider(
) gomatrixserverlib.EventProvider {
// A list of events that we have retried, if they were not included in
// the auth events supplied in the send_join.
- retries := map[string][]*gomatrixserverlib.Event{}
+ retries := map[string][]gomatrixserverlib.PDU{}
// Define a function which we can pass to Check to retrieve missing
// auth events inline. This greatly increases our chances of not having
// to repeat the entire set of checks just for a missing event or two.
- return func(roomVersion gomatrixserverlib.RoomVersion, eventIDs []string) ([]*gomatrixserverlib.Event, error) {
- returning := []*gomatrixserverlib.Event{}
+ return func(roomVersion gomatrixserverlib.RoomVersion, eventIDs []string) ([]gomatrixserverlib.PDU, error) {
+ returning := []gomatrixserverlib.PDU{}
verImpl, err := gomatrixserverlib.GetRoomVersion(roomVersion)
if err != nil {
return nil, err
@@ -680,7 +680,7 @@ func federatedEventProvider(
}
// Check the signatures of the event.
- if err := ev.VerifyEventSignatures(ctx, keyRing); err != nil {
+ if err := gomatrixserverlib.VerifyEventSignatures(ctx, ev, keyRing); err != nil {
return nil, fmt.Errorf("missingAuth VerifyEventSignatures: %w", err)
}