Add voice broadcast recording stores (#9319)

* Add voice broadcast recording stores

* Refactor startNewVoiceBroadcastRecording
This commit is contained in:
Michael Weimann 2022-09-28 10:22:50 +02:00 committed by GitHub
parent c14191bfb6
commit d775e403c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 769 additions and 119 deletions

View file

@ -55,9 +55,8 @@ import { isLocalRoom } from '../../../utils/localRoom/isLocalRoom';
import { Features } from '../../../settings/Settings';
import { VoiceMessageRecording } from '../../../audio/VoiceMessageRecording';
import {
VoiceBroadcastInfoEventContent,
VoiceBroadcastInfoEventType,
VoiceBroadcastInfoState,
startNewVoiceBroadcastRecording,
VoiceBroadcastRecordingsStore,
} from '../../../voice-broadcast';
let instanceCount = 0;
@ -508,16 +507,11 @@ export default class MessageComposer extends React.Component<IProps, IState> {
showStickersButton={this.showStickersButton}
toggleButtonMenu={this.toggleButtonMenu}
showVoiceBroadcastButton={this.showVoiceBroadcastButton}
onStartVoiceBroadcastClick={async () => {
const client = MatrixClientPeg.get();
client.sendStateEvent(
onStartVoiceBroadcastClick={() => {
startNewVoiceBroadcastRecording(
this.props.room.roomId,
VoiceBroadcastInfoEventType,
{
state: VoiceBroadcastInfoState.Started,
chunk_length: 300,
} as VoiceBroadcastInfoEventContent,
client.getUserId(),
MatrixClientPeg.get(),
VoiceBroadcastRecordingsStore.instance(),
);
this.toggleButtonMenu();
}}