diff --git a/event-schemas/examples/m.presence b/event-schemas/examples/m.presence new file mode 100644 index 000000000..695bd99b2 --- /dev/null +++ b/event-schemas/examples/m.presence @@ -0,0 +1,10 @@ +{ + "content": { + "avatar_url": "mxc://localhost:wefuiwegh8742w", + "last_active_ago": 2478593, + "presence": "online", + "user_id": "@example:localhost" + }, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.presence" +} diff --git a/event-schemas/examples/m.room.message.feedback b/event-schemas/examples/m.room.message.feedback new file mode 100644 index 000000000..6282305b0 --- /dev/null +++ b/event-schemas/examples/m.room.message.feedback @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "type": "delivered", + "target_event_id": "$WEIGFHFW:localhost" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message.feedback", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/m.room.redaction b/event-schemas/examples/m.room.redaction new file mode 100644 index 000000000..dd56e97c4 --- /dev/null +++ b/event-schemas/examples/m.room.redaction @@ -0,0 +1,10 @@ +{ + "age": 242352, + "content": {}, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.redaction", + "room_id": "!Cuyf34gef24t:localhost", + "redacts": "!fukweghifu23:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/schema/m.presence b/event-schemas/schema/m.presence new file mode 100644 index 000000000..815c6af98 --- /dev/null +++ b/event-schemas/schema/m.presence @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "content": { + "type": "object", + "properties": { + "avatar_url": { + "type": "string" + }, + "displayname": { + "type": "string" + }, + "last_active_ago": { + "type": "number" + }, + "presence": { + "type": "string", + "enum": ["online", "offline", "unavailable", "free_for_chat", "hidden"] + }, + "user_id": { + "type": "string" + } + }, + "required": ["presence", "user_id"] + }, + "type": { + "type": "string", + "enum": ["m.presence"] + }, + "event_id": { + "type": "string" + } + }, + "required": ["event_id", "type", "content"] +} diff --git a/event-schemas/schema/m.room.member b/event-schemas/schema/m.room.member index 8f5291b34..76b4c3604 100644 --- a/event-schemas/schema/m.room.member +++ b/event-schemas/schema/m.room.member @@ -10,7 +10,7 @@ "properties": { "membership": { "type": "string", - "enum": ["invite","join","leave","ban"] + "enum": ["invite","join","knock","leave","ban"] } }, "required": ["membership"] diff --git a/event-schemas/schema/m.room.message.feedback b/event-schemas/schema/m.room.message.feedback new file mode 100644 index 000000000..392e630df --- /dev/null +++ b/event-schemas/schema/m.room.message.feedback @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["delivered", "read"] + }, + "target_event_id": { + "type": "string" + } + }, + "required": ["type", "target_event_id"] + }, + "type": { + "type": "string", + "enum": ["m.room.message.feedback"] + } + } +} diff --git a/event-schemas/schema/m.room.redaction b/event-schemas/schema/m.room.redaction new file mode 100644 index 000000000..5b5dd6dbb --- /dev/null +++ b/event-schemas/schema/m.room.redaction @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + }, + "redacts": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["m.room.redaction"] + } + }, + "required": ["redacts"] +}