From b2e0a855cc092355529218085509370a6211f1f6 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 1 Feb 2016 17:45:45 +0000 Subject: [PATCH 1/2] Add 'event' to event context API also link through to the event schemas --- api/client-server/event_context.yaml | 17 +++++++++++------ specification/modules/event_context.rst | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/api/client-server/event_context.yaml b/api/client-server/event_context.yaml index 25e5ecf6..855adcce 100644 --- a/api/client-server/event_context.yaml +++ b/api/client-server/event_context.yaml @@ -67,23 +67,28 @@ paths: A list of room events that happened just before the requested event. items: - type: object - title: RoomEvent + allOf: + - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + event: + description: |- + Details of the requested event. + allOf: + - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" events_after: type: array description: |- A list of room events that happened just after the requested event. items: - type: object - title: RoomEvent + allOf: + - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" state: type: array description: |- The state of the room at the last event returned. items: - type: object - title: RoomEvent + allOf: + - "$ref": "../../event-schemas/schema/core-event-schema/state_event.yaml" examples: application/json: |- { diff --git a/specification/modules/event_context.rst b/specification/modules/event_context.rst index 2f798caa..a972e6fa 100644 --- a/specification/modules/event_context.rst +++ b/specification/modules/event_context.rst @@ -9,6 +9,8 @@ specified event. This allows clients to get the context surrounding an event. Client behaviour ---------------- +There is a single HTTP API for retrieving event context, documented below. + {{event_context_http_api}} Security considerations From 58b346e204d7d00dad435d095f5dfd48cec8c85c Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 1 Feb 2016 17:50:36 +0000 Subject: [PATCH 2/2] s/user_id/sender/ in context example response --- api/client-server/event_context.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/client-server/event_context.yaml b/api/client-server/event_context.yaml index 855adcce..d3139c9d 100644 --- a/api/client-server/event_context.yaml +++ b/api/client-server/event_context.yaml @@ -104,7 +104,7 @@ paths: "origin_server_ts": 1446030608551, "room_id": "!sCDvXTtzjpiPxaqkkt:localhost:8480", "type": "m.room.message", - "user_id": "@test:localhost:8480" + "sender": "@test:localhost:8480" } ], "events_before": [ @@ -118,7 +118,7 @@ paths: "origin_server_ts": 1446030607984, "room_id": "!sCDvXTtzjpiPxaqkkt:localhost:8480", "type": "m.room.message", - "user_id": "@test:localhost:8480" + "sender": "@test:localhost:8480" } ], "start": "t27-54_2_0_2", @@ -133,7 +133,7 @@ paths: "room_id": "!sCDvXTtzjpiPxaqkkt:localhost:8480", "state_key": "", "type": "m.room.create", - "user_id": "@test:localhost:8480" + "sender": "@test:localhost:8480" }, { "age": 2067105053, @@ -148,7 +148,7 @@ paths: "room_id": "!sCDvXTtzjpiPxaqkkt:localhost:8480", "state_key": "@test:localhost:8480", "type": "m.room.member", - "user_id": "@test:localhost:8480" + "sender": "@test:localhost:8480" } ] }