Merge pull request #165 from matrix-org/rav/flatten_sync
/sync response format tweaks
This commit is contained in:
commit
e7610c7cc5
4 changed files with 43 additions and 83 deletions
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"events": {
|
||||
"type": "array",
|
||||
"description": "List of event ids",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"type": "object",
|
||||
"allOf": [{"$ref":"definitions/room_event_batch.json"}],
|
||||
"allOf": [{"$ref":"definitions/event_batch.json"}],
|
||||
"properties": {
|
||||
"limited": {
|
||||
"type": "boolean",
|
||||
|
|
|
@ -95,7 +95,7 @@ paths:
|
|||
description: |-
|
||||
Updates to rooms.
|
||||
properties:
|
||||
joined:
|
||||
join:
|
||||
title: Joined Rooms
|
||||
type: object
|
||||
description: |-
|
||||
|
@ -104,19 +104,6 @@ paths:
|
|||
title: Joined Room
|
||||
type: object
|
||||
properties:
|
||||
event_map:
|
||||
title: EventMap
|
||||
type: object
|
||||
description: |-
|
||||
A map from event ID to events for this room. The
|
||||
events are referenced from the ``timeline`` and
|
||||
``state`` keys for this room.
|
||||
additionalProperties:
|
||||
title: Event
|
||||
description: An event object.
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: "definitions/event.json"
|
||||
state:
|
||||
title: State
|
||||
type: object
|
||||
|
@ -127,7 +114,7 @@ paths:
|
|||
``timeline``, if ``since`` is not given, or
|
||||
``full_state`` is true).
|
||||
allOf:
|
||||
- $ref: "definitions/room_event_batch.json"
|
||||
- $ref: "definitions/event_batch.json"
|
||||
timeline:
|
||||
title: Timeline
|
||||
type: object
|
||||
|
@ -145,7 +132,7 @@ paths:
|
|||
e.g. typing.
|
||||
allOf:
|
||||
- $ref: "definitions/event_batch.json"
|
||||
invited:
|
||||
invite:
|
||||
title: Invited Rooms
|
||||
type: object
|
||||
description: |-
|
||||
|
@ -172,35 +159,22 @@ paths:
|
|||
``invite_state``.
|
||||
allOf:
|
||||
- $ref: "definitions/event_batch.json"
|
||||
archived:
|
||||
title: Archived rooms
|
||||
leave:
|
||||
title: Left rooms
|
||||
type: object
|
||||
description: |-
|
||||
The rooms that the user has left or been banned from.
|
||||
additionalProperties:
|
||||
title: Archived Room
|
||||
title: Left Room
|
||||
type: object
|
||||
properties:
|
||||
event_map:
|
||||
title: EventMap
|
||||
type: object
|
||||
description: |-
|
||||
A map from event ID to events for this room. The
|
||||
events are referenced from the ``timeline`` and
|
||||
``state`` keys for this room.
|
||||
additionalProperties:
|
||||
title: Event
|
||||
description: An event object.
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: "definitions/event.json"
|
||||
state:
|
||||
title: State
|
||||
type: object
|
||||
description: |-
|
||||
The state updates for the room up to the start of the timeline.
|
||||
allOf:
|
||||
- $ref: "definitions/room_event_batch.json"
|
||||
- $ref: "definitions/event_batch.json"
|
||||
timeline:
|
||||
title: Timeline
|
||||
type: object
|
||||
|
@ -230,46 +204,43 @@ paths:
|
|||
]
|
||||
},
|
||||
"rooms": {
|
||||
"joined": {
|
||||
"join": {
|
||||
"!726s6s6q:example.com": {
|
||||
"event_map": {
|
||||
"$66697273743031:example.com": {
|
||||
"sender": "@alice:example.com",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@alice:example.com",
|
||||
"content": {"membership": "join"},
|
||||
"origin_server_ts": 1417731086795
|
||||
},
|
||||
"$7365636s6r6432:example.com": {
|
||||
"sender": "@bob:example.com",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@bob:example.com",
|
||||
"content": {"membership": "join"},
|
||||
"unsigned": {
|
||||
"prev_content": {"membership": "invite"}
|
||||
},
|
||||
"origin_server_ts": 1417731086795
|
||||
},
|
||||
"$74686972643033:example.com": {
|
||||
"sender": "@alice:example.com",
|
||||
"type": "m.room.message",
|
||||
"unsigned": {"age": 124524, "transaction_id": "1234"},
|
||||
"content": {
|
||||
"body": "I am a fish",
|
||||
"msgtype": "m.text"
|
||||
},
|
||||
"origin_server_ts": 1417731086797
|
||||
}
|
||||
},
|
||||
"state": {
|
||||
"events": [
|
||||
"$66697273743031:example.com"
|
||||
{
|
||||
"sender": "@alice:example.com",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@alice:example.com",
|
||||
"content": {"membership": "join"},
|
||||
"origin_server_ts": 1417731086795,
|
||||
"event_id": "$66697273743031:example.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timeline": {
|
||||
"events": [
|
||||
"$7365636s6r6432:example.com",
|
||||
"$74686972643033:example.com"
|
||||
{
|
||||
"sender": "@bob:example.com",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@bob:example.com",
|
||||
"content": {"membership": "join"},
|
||||
"prev_content": {"membership": "invite"},
|
||||
"origin_server_ts": 1417731086795,
|
||||
"event_id": "$7365636s6r6432:example.com"
|
||||
},
|
||||
{
|
||||
"sender": "@alice:example.com",
|
||||
"type": "m.room.message",
|
||||
"age": 124524,
|
||||
"txn_id": "1234",
|
||||
"content": {
|
||||
"body": "I am a fish",
|
||||
"msgtype": "m.text"
|
||||
},
|
||||
"origin_server_ts": 1417731086797,
|
||||
"event_id": "$74686972643033:example.com"
|
||||
}
|
||||
],
|
||||
"limited": true,
|
||||
"prev_batch": "t34-23535_0_0"
|
||||
|
@ -284,7 +255,7 @@ paths:
|
|||
}
|
||||
}
|
||||
},
|
||||
"invited": {
|
||||
"invite": {
|
||||
"!696r7674:example.com": {
|
||||
"invite_state": {
|
||||
"events": [
|
||||
|
@ -304,6 +275,6 @@ paths:
|
|||
}
|
||||
}
|
||||
},
|
||||
"archived": {}
|
||||
"leave": {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,9 @@ formatted for federation by:
|
|||
``origin``, ``prev_state``.
|
||||
* Adding an ``age`` to the ``unsigned`` object which gives the time in
|
||||
milliseconds that has elapsed since the event was sent.
|
||||
* Adding a ``prev_content`` to the ``unsigned`` object if the event is
|
||||
a ``state event`` which gives previous content of that state key.
|
||||
* Adding ``prev_content`` and ``prev_sender`` to the ``unsigned`` object if the
|
||||
event is a ``state event``, which give the previous content and previous
|
||||
sender of that state key
|
||||
* Adding a ``redacted_because`` to the ``unsigned`` object if the event was
|
||||
redacted which gives the event that redacted it.
|
||||
* Adding a ``transaction_id`` to the ``unsigned`` object if the event was sent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue