Wrap the "rooms" list inside an object so that we can add keys for pagination later

pull/977/head
Mark Haines 9 years ago
parent 218cf94ead
commit 4cb3f78d2b

@ -72,41 +72,44 @@ paths:
The batch token to supply in the ``since`` param of the next The batch token to supply in the ``since`` param of the next
``/sync`` request. ``/sync`` request.
rooms: rooms:
type: array type: object
description: |- properties:
A list of rooms that the client needs to update. roomlist:
items: type: array
type: object description: |-
properties: A list of rooms that the client needs to update.
room_id: items:
type: string
description: |-
The ID of the room.
event_map:
type: object type: object
description: |- properties:
A map from event ID to events for this room. The events room_id:
are referenced from the ``timeline`` and ``state`` keys type: string
for this room. description: |-
additionalProperties: The ID of the room.
description: An event object. event_map:
type: object type: object
state: description: |-
description: |- A map from event ID to events for this room. The events
The state updates for the room. are referenced from the ``timeline`` and ``state`` keys
allOf: for this room.
- $ref: "definitions/room_event_batch.json" additionalProperties:
timeline: description: An event object.
description: |- type: object
The timeline of messages and state changes in the room. state:
allOf: description: |-
- $ref: "definitions/timeline_batch.json" The state updates for the room.
ephemeral: allOf:
description: |- - $ref: "definitions/room_event_batch.json"
The ephemeral events in the room that aren't recorded timeline:
in the timeline or state of the room. E.g. typing. description: |-
allOf: The timeline of messages and state changes in the room.
- $ref: "definitions/event_batch.json" allOf:
- $ref: "definitions/timeline_batch.json"
ephemeral:
description: |-
The ephemeral events in the room that aren't recorded
in the timeline or state of the room. E.g. typing.
allOf:
- $ref: "definitions/event_batch.json"
public_user_data: public_user_data:
description: |- description: |-
The updates to publicly visible user data. The updates to publicly visible user data.
@ -145,53 +148,55 @@ paths:
} }
] ]
}, },
"rooms": [{ "rooms": {
"room_id": "!726s6s6q:example.com", "roomlist": [{
"event_map": { "room_id": "!726s6s6q:example.com",
"$66697273743031:example.com": { "event_map": {
"sender": "@alice:example.com", "$66697273743031:example.com": {
"type": "m.room.member", "sender": "@alice:example.com",
"state_key": "@alice:example.com", "type": "m.room.member",
"content": {"membership": "join"}, "state_key": "@alice:example.com",
"origin_server_ts": 1417731086795 "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"},
"origin_server_ts": 1417731086795
},
"$74686972643033:example.com": {
"sender": "@alice:example.com",
"type": "m.room.message",
"unsigned": {"age": "124524", "txn_id": "1234"},
"content": {"body": "I am a fish", "msgtype": "m.text"},
"origin_server_ts": 1417731086797
}
}, },
"$7365636s6r6432:example.com": { "state": {
"sender": "@bob:example.com", "events": [
"type": "m.room.member", "$66697273743031:example.com",
"state_key": "@bob:example.com", "$7365636s6r6432:example.com"
"content": {"membership": "join"}, ]
"origin_server_ts": 1417731086795
}, },
"$74686972643033:example.com": { "timeline": {
"sender": "@alice:example.com", "events": [
"type": "m.room.message", "$7365636s6r6432:example.com",
"unsigned": {"age": "124524", "txn_id": "1234"}, "$74686972643033:example.com"
"content": {"body": "I am a fish", "msgtype": "m.text"}, ],
"origin_server_ts": 1417731086797 "limited": true,
"prev_batch": "t34-23535_0_0"
},
"ephemeral": {
"events": [
{
"room_id": "!726s6s6q:example.com",
"type": "m.typing",
"content": {"user_ids": ["@alice:example.com"]}
}
]
} }
}, }]
"state": { }
"events": [
"$66697273743031:example.com",
"$7365636s6r6432:example.com"
]
},
"timeline": {
"events": [
"$7365636s6r6432:example.com",
"$74686972643033:example.com"
],
"limited": true,
"prev_batch": "t34-23535_0_0"
},
"ephemeral": {
"events": [
{
"room_id": "!726s6s6q:example.com",
"type": "m.typing",
"content": {"user_ids": ["@alice:example.com"]}
}
]
}
}]
} }

Loading…
Cancel
Save