In order to know if a megolm session is safe to share to invited users as part of Encrypted history sharing, we need to annotate each session with a shared_history flag.
It is proposed that we add a field to the ExportedSessionData format.
We need to:
- set it when sharing keys over
m.room_key
- store it in the db when receiving over
m.room_key
- set it in the export file
- read from the export file
- set in key backup
- read from key backup
- ensure we rotate the key if the setting changes
The details of the flag should be the same as in matrix-org/matrix-spec-proposals#3061