Add shared_history flag to data structures

This commit is contained in:
Richard van der Hoff 2026-06-15 15:29:48 +01:00
parent 1efc0623fa
commit 272ce4cc08
4 changed files with 22 additions and 2 deletions

View file

@ -1967,7 +1967,7 @@ In order to enable end-to-end encryption in a room, clients can send an
When creating a Megolm session in a room, clients must share the When creating a Megolm session in a room, clients must share the
corresponding session key using Olm with the intended recipients, so corresponding session key using Olm with the intended recipients, so
that they can decrypt future messages encrypted using this session. An that they can decrypt future messages encrypted using this session. An
`m.room_key` event is used to do this. Clients must also handle [`m.room_key`](#mroom_key) event is used to do this. Clients must also handle
`m.room_key` events sent by other devices in order to decrypt their `m.room_key` events sent by other devices in order to decrypt their
messages. messages.

View file

@ -49,6 +49,12 @@ properties:
description: |- description: |-
Unpadded base64-encoded session key in [session-export format](https://gitlab.matrix.org/matrix-org/olm/blob/master/docs/megolm.md#session-export-format). Unpadded base64-encoded session key in [session-export format](https://gitlab.matrix.org/matrix-org/olm/blob/master/docs/megolm.md#session-export-format).
example: "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8Llf..." example: "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8Llf..."
shared_history:
x-addedInMatrixVersion: "1.19"
type: boolean
description: |-
Whether the session is [shareable](/client-server-api/#shareable-encryption-sessions).
example: false
required: required:
- algorithm - algorithm
- forwarding_curve25519_key_chain - forwarding_curve25519_key_chain

View file

@ -5,6 +5,7 @@
"algorithm": "m.megolm.v1.aes-sha2", "algorithm": "m.megolm.v1.aes-sha2",
"room_id": "!Cuyf34gef24t:localhost", "room_id": "!Cuyf34gef24t:localhost",
"session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ", "session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ",
"session_key": "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8LlfJL7qNBEY..." "session_key": "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8LlfJL7qNBEY...",
"shared_history": false
} }
} }

View file

@ -25,6 +25,19 @@ properties:
session_key: session_key:
type: string type: string
description: The key to be exchanged. description: The key to be exchanged.
shared_history:
x-addedInMatrixVersion: "1.19"
type: boolean
description: |
`true` indicates that the creator of this encryption considers that
the session is [shareable](/client-server-api/#shareable-encryption-sessions):
in other words, the sender has observed that the [room history
visibility](/client-server-api/#room-history-visibility) is set to
`shared` or `world_readable`, and that they understand and agree that
the session keys may be shared with newly-invited users in future.
Absence, or any other value, indicates that the creator of the
session does not consider the session to be shareable.
required: required:
- algorithm - algorithm
- room_id - room_id