From e58f816ad39c26461527c2ba47d2db8d544f7cb1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 8 Sep 2015 16:49:14 +0100 Subject: [PATCH] Add m.receipt schema --- event-schemas/examples/v1/m.receipt | 13 +++++++++ event-schemas/schema/v1/m.receipt | 43 +++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 event-schemas/examples/v1/m.receipt create mode 100644 event-schemas/schema/v1/m.receipt diff --git a/event-schemas/examples/v1/m.receipt b/event-schemas/examples/v1/m.receipt new file mode 100644 index 00000000..83515317 --- /dev/null +++ b/event-schemas/examples/v1/m.receipt @@ -0,0 +1,13 @@ +{ + "type": "m.receipt", + "room_id": "!KpjVgQyZpzBwvMBsnT:matrix.org", + "content": { + "$1435641916114394fHBLK:matrix.org": { + "read": { + "@rikj:jki.re": { + "ts": 1436451550453 + } + } + } + } +} diff --git a/event-schemas/schema/v1/m.receipt b/event-schemas/schema/v1/m.receipt new file mode 100644 index 00000000..b9d29c30 --- /dev/null +++ b/event-schemas/schema/v1/m.receipt @@ -0,0 +1,43 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "title": "Receipt Event", + "description": "Informs the client of new receipts.", + "properties": { + "content": { + "type": "object", + "description": "The event ids which the receipts relate to.", + "patternProperties": { + "^\$": { + "type": "object", + "description": "The types of the receipts." + "additionalProperties": { + "type": "object", + "description": "User ids of the receipts", + "patternProperties": { + "^@": { + "type": "object", + "properties": { + "ts": { + "type": "number", + "description": "The timestamp the receipt was sent at" + } + } + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "type": { + "type": "string", + "enum": ["m.presence"] + }, + "room_id": { + "type": "string" + } + }, + "required": ["room_id", "type", "content"] +}