send "recording" notifications when audio is being recorded

This commit is contained in:
or-else
2022-12-10 18:17:03 -08:00
parent 6aca7e527e
commit 692e6e1d8f
14 changed files with 74 additions and 35 deletions
+7 -2
View File
@@ -743,10 +743,14 @@ class MessagesView extends React.Component {
this.props.onChangePermissions(this.state.topic, DEFAULT_P2P_ACCESS_MODE, this.state.topic);
}
sendKeyPress() {
sendKeyPress(audio) {
const topic = this.props.tinode.getTopic(this.state.topic);
if (topic.isSubscribed()) {
topic.noteKeyPress();
if (audio) {
topic.noteRecording(true);
} else {
topic.noteKeyPress();
}
}
}
@@ -1335,6 +1339,7 @@ class MessagesView extends React.Component {
reply={this.state.reply}
initMessage={this.state.contentToEdit}
onKeyPress={this.sendKeyPress}
onRecordingProgress={this.sendKeyPress}
onSendMessage={this.sendMessage}
onAttachFile={this.props.forwardMessage ? null : this.handleAttachFile}
onAttachImage={this.props.forwardMessage ? null : this.handleAttachImage}