Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Include device_id in voice broadcast info events #9394

Merged
merged 1 commit into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/voice-broadcast/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export enum VoiceBroadcastInfoState {
}

export interface VoiceBroadcastInfoEventContent {
device_id: string;
state: VoiceBroadcastInfoState;
chunk_length?: number;
["m.relates_to"]?: {
Expand Down
1 change: 1 addition & 0 deletions src/voice-broadcast/models/VoiceBroadcastRecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export class VoiceBroadcastRecording
this.infoEvent.getRoomId(),
VoiceBroadcastInfoEventType,
{
device_id: this.client.getDeviceId(),
state: VoiceBroadcastInfoState.Stopped,
["m.relates_to"]: {
rel_type: RelationType.Reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const startNewVoiceBroadcastRecording = async (
roomId,
VoiceBroadcastInfoEventType,
{
device_id: client.getDeviceId(),
state: VoiceBroadcastInfoState.Started,
chunk_length: 300,
} as VoiceBroadcastInfoEventContent,
Expand Down
4 changes: 4 additions & 0 deletions test/voice-broadcast/models/VoiceBroadcastRecording-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ describe("VoiceBroadcastRecording", () => {
describe("when created for a Voice Broadcast Info without relations", () => {
beforeEach(() => {
infoEvent = mkVoiceBroadcastInfoEvent({
device_id: client.getDeviceId(),
state: VoiceBroadcastInfoState.Started,
});
setUpVoiceBroadcastRecording();
Expand All @@ -179,6 +180,7 @@ describe("VoiceBroadcastRecording", () => {
roomId,
VoiceBroadcastInfoEventType,
{
device_id: client.getDeviceId(),
state: VoiceBroadcastInfoState.Stopped,
["m.relates_to"]: {
rel_type: RelationType.Reference,
Expand Down Expand Up @@ -344,6 +346,7 @@ describe("VoiceBroadcastRecording", () => {
describe("when created for a Voice Broadcast Info with a Stopped relation", () => {
beforeEach(() => {
infoEvent = mkVoiceBroadcastInfoEvent({
device_id: client.getDeviceId(),
state: VoiceBroadcastInfoState.Started,
chunk_length: 300,
});
Expand All @@ -353,6 +356,7 @@ describe("VoiceBroadcastRecording", () => {
} as unknown as Relations;
mocked(relationsContainer.getRelations).mockReturnValue([
mkVoiceBroadcastInfoEvent({
device_id: client.getDeviceId(),
state: VoiceBroadcastInfoState.Stopped,
["m.relates_to"]: {
rel_type: RelationType.Reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ describe("startNewVoiceBroadcastRecording", () => {
event: true,
type: VoiceBroadcastInfoEventType,
content: {
device_id: client.getDeviceId(),
state: VoiceBroadcastInfoState.Started,
},
user: client.getUserId(),
Expand Down