Filterstring`url:"filter,omitempty"`// The ID of a filter created using the filter API or a filter JSON object encoded as a string. The server will detect whether it is an ID or a JSON object by whether the first character is a "{" open brace. Passing the JSON inline is best suited to one off requests. Creating a filter using the filter API is recommended for clients that reuse the same filter multiple times, for example in long poll requests.
Sincestring`url:"since,omitempty"`// A point in time to continue a sync from.
FullStatebool`url:"full_state,omitempty"`// Controls whether to include the full state for all rooms the user is a member of.
SetPresenceSetPresence`url:"set_presence,omitempty"`// Controls whether the client is automatically marked as online by polling this API. If this parameter is omitted then the client is automatically marked as online when it uses this API. Otherwise if the parameter is set to "offline" then the client is not marked as being online when it uses this API. When set to "unavailable", the client is marked as being idle. One of: ["offline", "online", "unavailable"]
Timeoutint`url:"timeout,omitempty"`// The maximum time to wait, in milliseconds, before returning this request. If no events (or other data) become available before this time elapses, the server will return a response with empty fields.
}
typeJoinedRoomstruct{
StateState`json:"state"`// Updates to the state, between the time indicated by the since parameter, and the start of the timeline (or all state up to the start of the timeline, if since is not given, or full_state is true).
TimelineTimeline`json:"timeline"`// The timeline of messages and state changes in the room.
EphemeralEphemeral`json:"ephemeral"`// The ephemeral events in the room that aren't recorded in the timeline or state of the room. e.g. typing.
AccountDataAccountData`json:"account_data"`// The private data that this user has attached to this room.
UnreadNotificationsUnreadNotificationCounts`json:"unread_notifications"`// Counts of unread notifications for this room
}
typeEphemeralstruct{
Events[]Event`json:"events"`// List of events.
}
typeUnreadNotificationCountsstruct{
HighlightCountint`json:"highlight_count"`// The number of unread notifications for this room with the highlight flag set
NotificationCountint`json:"notification_count"`// The total number of unread notifications for this room
}
typeInvitedRoomstruct{
InviteStateInviteState`json:"invite_state"`// The state of a room that the user has been invited to. These state events may only have the sender, type, state_key and content keys present. These events do not replace any state that the client already has for the room, for example if the client has archived the room. Instead the client should keep two separate copies of the state: the one from the invite_state and one from the archived state. If the client joins the room then the current state will be given as a delta against the archived state not the invite_state.
}
typeInviteStatestruct{
Events[]StrippedState`json:"events"`// The StrippedState events that form the invite state.
}
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.
}
typeLeftRoomstruct{
StateState`json:"state"`// The state updates for the room up to the start of the timeline.
TimelineTimeline`json:"timeline"`// The timeline of messages and state changes in the room up to the point when the user left.
AccountDataAccountData`json:"account_data"`// The private data that this user has attached to this room.
}
typeStatestruct{
events[]StateEvent`json:"events"`// List of events.
}
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.
}
typeTimelinestruct{
Events[]RoomEvent`json:"events"`// List of events.
Limitedbool`json:"limited"`// True if the number of events returned was limited by the limit on the filter.
PrevBatchstring`json:"prev_batch"`// A token that can be supplied to the from parameter of the rooms/{roomId}/messages endpoint.
}
typeRoomEventstruct{
// 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.
OriginServerTsint64`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.
}
typeUnsignedDatastruct{
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.
}
typeAccountDatastruct{
Events[]Event`json:"events"`// List of events.
}
typeEventstruct{
// 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'
}
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.
}
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.
}
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.
}
// TODO: проверить правильность выбора типа
typeToDevicestruct{
events[]Event`json:"events`// List of send-to-device messages
}
typeDeviceListsstruct{
Changed[]string`json:"changed"`// List of users who have updated their device identity keys, or who now share an encrypted room with the client since the previous sync response.
Left[]string`json:"left"`// List of users with whom we do not share any encrypted rooms anymore since the previous sync response.