mirror of https://github.com/matrix-org/gomatrix
unrelated: Add PrevContent
This commit is contained in:
parent
dc3a2baaff
commit
fa4abd0af9
19
events.go
19
events.go
|
@ -7,15 +7,16 @@ import (
|
||||||
|
|
||||||
// Event represents a single Matrix event.
|
// Event represents a single Matrix event.
|
||||||
type Event struct {
|
type Event struct {
|
||||||
StateKey *string `json:"state_key,omitempty"` // The state key for the event. Only present on State Events.
|
StateKey *string `json:"state_key,omitempty"` // The state key for the event. Only present on State Events.
|
||||||
Sender string `json:"sender"` // The user ID of the sender of the event
|
Sender string `json:"sender"` // The user ID of the sender of the event
|
||||||
Type string `json:"type"` // The event type
|
Type string `json:"type"` // The event type
|
||||||
Timestamp int64 `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server
|
Timestamp int64 `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server
|
||||||
ID string `json:"event_id"` // The unique ID of this event
|
ID string `json:"event_id"` // The unique ID of this event
|
||||||
RoomID string `json:"room_id"` // The room the event was sent to. May be nil (e.g. for presence)
|
RoomID string `json:"room_id"` // The room the event was sent to. May be nil (e.g. for presence)
|
||||||
Content map[string]interface{} `json:"content"` // The JSON content of the event.
|
Redacts string `json:"redacts,omitempty"` // The event ID that was redacted if a m.room.redaction event
|
||||||
Redacts string `json:"redacts,omitempty"` // The event ID that was redacted if a m.room.redaction event
|
Unsigned map[string]interface{} `json:"unsigned"` // The unsigned portions of the event, such as age and prev_content
|
||||||
Unsigned map[string]interface{} `json:"unsigned"` // The unsigned portions of the event, such as age and prev_content
|
Content map[string]interface{} `json:"content"` // The JSON content of the event.
|
||||||
|
PrevContent map[string]interface{} `json:"prev_content,omitempty"` // The JSON prev_content of the event.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Body returns the value of the "body" key in the event content if it is
|
// Body returns the value of the "body" key in the event content if it is
|
||||||
|
|
Loading…
Reference in New Issue