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'
}
typeEventContentstruct{
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.
}
typeStatestruct{
events[]StateEvent`json:"events"`// List of events.
}
typeInvitestruct{
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.