Fix displaying already stopped broadcasts in the timeline (#9470)

This commit is contained in:
Michael Weimann 2022-10-20 12:17:38 +02:00 committed by GitHub
parent 3c9ba3e69f
commit d898af820b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 26 deletions

View file

@ -23,7 +23,17 @@ export const mkVoiceBroadcastInfoStateEvent = (
roomId: string,
state: VoiceBroadcastInfoState,
sender: string,
startedInfoEvent?: MatrixEvent,
): MatrixEvent => {
const relationContent = {};
if (startedInfoEvent) {
relationContent["m.relates_to"] = {
event_id: startedInfoEvent.getId(),
rel_type: "m.reference",
};
}
return mkEvent({
event: true,
room: roomId,
@ -32,6 +42,7 @@ export const mkVoiceBroadcastInfoStateEvent = (
skey: sender,
content: {
state,
...relationContent,
},
});
};