mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 05:12:26 +03:00
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
This commit is contained in:
parent
2475cf4b61
commit
b189edf4f4
108 changed files with 660 additions and 514 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue