aboutsummaryrefslogtreecommitdiff
path: root/roomserver/api/output.go
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-04-27 12:54:20 +0100
committerGitHub <noreply@github.com>2023-04-27 12:54:20 +0100
commitb189edf4f43ff34b69d6c60aeb0efb60dd549c86 (patch)
tree4c08aeda694f3e1cf17c66cf0e4b2b306af6a8df /roomserver/api/output.go
parent2475cf4b61747e76a524af6f71a4eb7e112812af (diff)
Remove gmsl.HeaderedEvent (#3068)
Replaced with types.HeaderedEvent _for now_. In reality we want to move them all to gmsl.Event and only use HeaderedEvent when we _need_ to bundle the version/event ID with the event (seriailsation boundaries, and even then only when we don't have the room version). Requires https://github.com/matrix-org/gomatrixserverlib/pull/373
Diffstat (limited to 'roomserver/api/output.go')
-rw-r--r--roomserver/api/output.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/roomserver/api/output.go b/roomserver/api/output.go
index 73788747..16b50495 100644
--- a/roomserver/api/output.go
+++ b/roomserver/api/output.go
@@ -15,6 +15,7 @@
package api
import (
+ "github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/spec"
)
@@ -107,7 +108,7 @@ const (
// prev_events.
type OutputNewRoomEvent struct {
// The Event.
- Event *gomatrixserverlib.HeaderedEvent `json:"event"`
+ Event *types.HeaderedEvent `json:"event"`
// Does the event completely rewrite the room state? If so, then AddsStateEventIDs
// will contain the entire room state.
RewritesState bool `json:"rewrites_state,omitempty"`
@@ -170,8 +171,8 @@ type OutputNewRoomEvent struct {
HistoryVisibility gomatrixserverlib.HistoryVisibility `json:"history_visibility"`
}
-func (o *OutputNewRoomEvent) NeededStateEventIDs() ([]*gomatrixserverlib.HeaderedEvent, []string) {
- addsStateEvents := make([]*gomatrixserverlib.HeaderedEvent, 0, 1)
+func (o *OutputNewRoomEvent) NeededStateEventIDs() ([]*types.HeaderedEvent, []string) {
+ addsStateEvents := make([]*types.HeaderedEvent, 0, 1)
missingEventIDs := make([]string, 0, len(o.AddsStateEventIDs))
for _, eventID := range o.AddsStateEventIDs {
if eventID != o.Event.EventID() {
@@ -194,7 +195,7 @@ func (o *OutputNewRoomEvent) NeededStateEventIDs() ([]*gomatrixserverlib.Headere
// should build their current room state up from OutputNewRoomEvents only.
type OutputOldRoomEvent struct {
// The Event.
- Event *gomatrixserverlib.HeaderedEvent `json:"event"`
+ Event *types.HeaderedEvent `json:"event"`
HistoryVisibility gomatrixserverlib.HistoryVisibility `json:"history_visibility"`
}
@@ -205,7 +206,7 @@ type OutputNewInviteEvent struct {
// The room version of the invited room.
RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
// The "m.room.member" invite event.
- Event *gomatrixserverlib.HeaderedEvent `json:"event"`
+ Event *types.HeaderedEvent `json:"event"`
}
// An OutputRetireInviteEvent is written whenever an existing invite is no longer
@@ -232,7 +233,7 @@ type OutputRedactedEvent struct {
// The event ID that was redacted
RedactedEventID string
// The value of `unsigned.redacted_because` - the redaction event itself
- RedactedBecause *gomatrixserverlib.HeaderedEvent
+ RedactedBecause *types.HeaderedEvent
}
// An OutputNewPeek is written whenever a user starts peeking into a room