mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 05:12:46 +00:00
Emit redacted_event from the roomserver when redactions are validated (#1186)
* Emit redacted_event from the roomserver when redactions are validated - Consume them in the currentstateserver and act accordingly. - Add integration test for the roomserver to check that injecting `m.room.redaction` events result in `redacted_event` being emitted. * Linting * Ignore events that redact themselves
This commit is contained in:
parent
d7a8bbff72
commit
99ea1f9b48
18 changed files with 406 additions and 107 deletions
|
@ -28,6 +28,8 @@ const (
|
|||
OutputTypeNewInviteEvent OutputType = "new_invite_event"
|
||||
// OutputTypeRetireInviteEvent indicates that the event is an OutputRetireInviteEvent
|
||||
OutputTypeRetireInviteEvent OutputType = "retire_invite_event"
|
||||
// OutputTypeRedactedEvent indicates that the event is an OutputRedactedEvent
|
||||
OutputTypeRedactedEvent OutputType = "redacted_event"
|
||||
)
|
||||
|
||||
// An OutputEvent is an entry in the roomserver output kafka log.
|
||||
|
@ -41,6 +43,8 @@ type OutputEvent struct {
|
|||
NewInviteEvent *OutputNewInviteEvent `json:"new_invite_event,omitempty"`
|
||||
// The content of event with type OutputTypeRetireInviteEvent
|
||||
RetireInviteEvent *OutputRetireInviteEvent `json:"retire_invite_event,omitempty"`
|
||||
// The content of event with type OutputTypeRedactedEvent
|
||||
RedactedEvent *OutputRedactedEvent `json:"redacted_event,omitempty"`
|
||||
}
|
||||
|
||||
// An OutputNewRoomEvent is written when the roomserver receives a new event.
|
||||
|
@ -165,3 +169,13 @@ type OutputRetireInviteEvent struct {
|
|||
// "leave" or "ban".
|
||||
Membership string
|
||||
}
|
||||
|
||||
// An OutputRedactedEvent is written whenever a redaction has been /validated/.
|
||||
// Downstream components MUST redact the given event ID if they have stored the
|
||||
// event JSON. It is guaranteed that this event ID has been seen before.
|
||||
type OutputRedactedEvent struct {
|
||||
// The event ID that was redacted
|
||||
RedactedEventID string
|
||||
// The value of `unsigned.redacted_because` - the redaction event itself
|
||||
RedactedBecause gomatrixserverlib.HeaderedEvent
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue