You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Handle voice broadcast last_chunk_sequence (#9812)
This commit is contained in:
@@ -24,12 +24,16 @@ import {
|
||||
} from "../../../src/voice-broadcast";
|
||||
import { mkEvent } from "../../test-utils";
|
||||
|
||||
// timestamp incremented on each call to prevent duplicate timestamp
|
||||
let timestamp = new Date().getTime();
|
||||
|
||||
export const mkVoiceBroadcastInfoStateEvent = (
|
||||
roomId: Optional<string>,
|
||||
state: Optional<VoiceBroadcastInfoState>,
|
||||
senderId: Optional<string>,
|
||||
senderDeviceId: Optional<string>,
|
||||
startedInfoEvent?: MatrixEvent,
|
||||
lastChunkSequence?: number,
|
||||
): MatrixEvent => {
|
||||
const relationContent = {};
|
||||
|
||||
@@ -40,6 +44,8 @@ export const mkVoiceBroadcastInfoStateEvent = (
|
||||
};
|
||||
}
|
||||
|
||||
const lastChunkSequenceContent = lastChunkSequence ? { last_chunk_sequence: lastChunkSequence } : {};
|
||||
|
||||
return mkEvent({
|
||||
event: true,
|
||||
// @ts-ignore allow everything here for edge test cases
|
||||
@@ -53,7 +59,9 @@ export const mkVoiceBroadcastInfoStateEvent = (
|
||||
state,
|
||||
device_id: senderDeviceId,
|
||||
...relationContent,
|
||||
...lastChunkSequenceContent,
|
||||
},
|
||||
ts: timestamp++,
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user