Content()json.RawMessage// Required. The fields in this object will vary depending on the type of event. When interacting with the REST API, this is the HTTP body.
Type()EventType// Required. The type of event. This SHOULD be namespaced similar to Java package naming conventions e.g. 'com.example.subdomain.event.type'
AvatarURLstring`json:"avatar_url"`// The avatar URL for this user, if any. This is added by the homeserver.
// TODO: string or null
DisplayNamestring`json:"displayname"`// The display name for this user, if any. This is added by the homeserver.
MembershipMembership`json:"membership"`// Required. The membership state of the user. One of: ["invite", "join", "knock", "leave", "ban"]
IsDirectbool`json:"is_direct"`// Flag indicating if the room containing this event was created with the intention of being a direct chat. See Direct Messaging.
UnsignedUnsignedData`json:"unsigned"`// Contains optional extra information about the event.
}
typeStateEventstruct{
// TODO: object?
Contentjson.RawMessage`json:"content"`// Required. The fields in this object will vary depending on the type of event. When interacting with the REST API, this is the HTTP body.
Typestring`json:"type"`// Required. The type of event. This SHOULD be namespaced similar to Java package naming conventions e.g. 'com.example.subdomain.event.type'
EventIDstring`json:"event_id"`// Required. The globally unique event identifier.
Senderstring`json:"sender"`// Required. Contains the fully-qualified ID of the user who sent this event.
OriginServerTsint`json:"origin_server_ts"`// Required. Timestamp in milliseconds on originating homeserver when this event was sent.
UnsignedUnsignedData`json:"unsigned"`// Contains optional extra information about the event.
PrevContentEventContent`json:"prev_content"`// Optional. The previous content for this event. If there is no previous content, this key will be missing.
StateKeystring`json:"state_key"`// Required. A unique key which defines the overwriting semantics for this piece of room state. This value is often a zero-length string. The presence of this key makes this event a State Event. State keys starting with an @ are reserved for referencing user IDs, such as room members. With the exception of a few events, state events set with a given user's ID as the state key MUST only be set by that user.
}
typesignedstruct{
Mxidstring`json:"mxid"`// Required. The invited matrix user ID. Must be equal to the user_id property of the event.
// TODO:
// Signatures Signatures `json:"signatures"` // Required. A single signature from the verifying server, in the format specified by the Signing Events section of the server-server API.
Tokenstring`json:"token"`// Required. The token property of the containing third_party_invite object.
DisplayNamestring`json:"display_name"`// Required. A name which can be displayed to represent the user instead of their third party identifier
Signedsigned`json:"signed"`// Required. A block of content which has been signed, which servers can use to verify the event. Clients should ignore this.
}
typeEphemeralstruct{
Events[]Event`json:"events"`// List of events.
}
typeStrippedStatestruct{
// TODO: в документации EventContent, хотя вроде сервер выдаёт json.RawMessage
Contentjson.RawMessage`json:"content"`// Required. The content for the event.
StateKeystring`json:"state_key"`// Required. The state_key for the event.
Typestring`json:"type"`// Required. The type for the event.
Senderstring`json:"sender"`// Required. The sender for the event.
Ageint`json:"age"`// The time in milliseconds that has elapsed since the event was sent. This field is generated by the local homeserver, and may be incorrect if the local time on at least one of the two servers is out of sync, which can cause the age to either be negative or greater than it actually is.
RedactedBecauseEvent`json:"redacted_because"`// Optional. The event that redacted this event, if any.
TransactionIDstring`json:"transaction_id"`// The client-supplied transaction ID, if the client being given the event is the same one which sent it.
}
typePresencestruct{
Events[]Event`json:"events"`// List of events.
}
typeToDevicestruct{
Events[]Event`json:"events`// List of send-to-device messages