|
| 1 | +# Copyright 2018 New Vector Ltd |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +type: object |
| 16 | +title: Receipt EDU |
| 17 | +description: |- |
| 18 | + An EDU representing receipt updates for users of the sending homeserver. |
| 19 | + When receiving receipts, the server should only update entries that are |
| 20 | + listed in the EDU. Receipts previously received that do not appear in the |
| 21 | + EDU should not be removed or otherwise manipulated. |
| 22 | +allOf: |
| 23 | + - $ref: ../edu.yaml |
| 24 | + - type: object |
| 25 | + properties: |
| 26 | + edu_type: |
| 27 | + type: string |
| 28 | + description: The string ``m.receipt`` |
| 29 | + example: "m.receipt" |
| 30 | + content: |
| 31 | + type: object |
| 32 | + description: |- |
| 33 | + Receipts for a particular room. The string key is the room ID for |
| 34 | + which the receipts under it belong. |
| 35 | + additionalProperties: |
| 36 | + type: object |
| 37 | + title: Room Receipts |
| 38 | + properties: |
| 39 | + # We strongly define the receipt type to help spec future ones later |
| 40 | + # on. At that point, m.read can become optional (maybe). |
| 41 | + "m.read": |
| 42 | + type: object |
| 43 | + description: Read receipts for users in the room. |
| 44 | + title: User Read Receipt |
| 45 | + properties: |
| 46 | + event_ids: |
| 47 | + type: array |
| 48 | + description: |- |
| 49 | + The event ID that the user has read up to. Must be exactly |
| 50 | + one element in length. |
| 51 | + minItems: 1 |
| 52 | + maxItems: 1 |
| 53 | + items: |
| 54 | + type: string |
| 55 | + example: ['$read_this_event:matrix.org'] |
| 56 | + data: |
| 57 | + type: object |
| 58 | + description: Metadata for the read receipt. |
| 59 | + title: Read Receipt Metadata |
| 60 | + properties: |
| 61 | + ts: |
| 62 | + type: integer |
| 63 | + format: int64 |
| 64 | + description: |- |
| 65 | + A POSIX timestamp in milliseconds for when the user read |
| 66 | + the event specified in the read receipt. |
| 67 | + example: 1533358089009 |
| 68 | + required: ['ts'] |
| 69 | + required: ['event_ids', 'data'] |
| 70 | + required: ['m.read'] |
| 71 | + example: { |
| 72 | + "!some_room:domain.com": { |
| 73 | + "m.read": { |
| 74 | + "@john:matrix.org": { |
| 75 | + "event_ids": ["$read_this_event:matrix.org"], |
| 76 | + "data": { |
| 77 | + "ts": 1533358089009 |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | + } |
| 82 | + } |
0 commit comments