Video calls: consolidate onHangup and onClose.

This commit is contained in:
aforge
2022-03-14 21:04:29 -07:00
parent 824f15aa29
commit ff7f8faf37
2 changed files with 6 additions and 21 deletions
+6 -19
View File
@@ -115,7 +115,7 @@ class MessagesView extends React.Component {
this.handleCancelReply = this.handleCancelReply.bind(this); this.handleCancelReply = this.handleCancelReply.bind(this);
this.handleQuoteClick = this.handleQuoteClick.bind(this); this.handleQuoteClick = this.handleQuoteClick.bind(this);
this.handleRtcClick = this.handleRtcClick.bind(this); this.handleRtcClick = this.handleRtcClick.bind(this);
this.handleRtcClose = this.handleRtcClose.bind(this); this.handleTeleHangup = this.handleTeleHangup.bind(this);
this.chatMessageRefs = {}; this.chatMessageRefs = {};
this.getOrCreateMessageRef = this.getOrCreateMessageRef.bind(this); this.getOrCreateMessageRef = this.getOrCreateMessageRef.bind(this);
@@ -167,8 +167,7 @@ class MessagesView extends React.Component {
this.leave(prevState.topic); this.leave(prevState.topic);
if (prevState.rtcPanel) { if (prevState.rtcPanel) {
console.log('hangup: ', prevState.topic); console.log('hangup: ', prevState.topic);
this.props.onTeleHangup(prevState.topic, prevProps.callSeq); this.handleTeleHangup(prevState.topic, prevProps.callSeq);
this.handleRtcClose();
} }
} }
@@ -781,24 +780,17 @@ class MessagesView extends React.Component {
handleRtcClick() { handleRtcClick() {
this.setState({ this.setState({
rtcPanel: { rtcPanel: { topic: this.state.topic }
/*
file: file,
name: file.name,
size: file.size,
type: file.type
*/
topic: this.state.topic
}
}); });
} }
handleRtcClose() { handleTeleHangup(topic, seq) {
this.props.onVideoCallClosed(); this.props.onVideoCallClosed();
this.setState({ this.setState({
rtcPanel: null rtcPanel: null
}); });
this.props.onTeleHangup(topic, seq);
} }
// sendImageAttachment sends the image bits inband as Drafty message. // sendImageAttachment sends the image bits inband as Drafty message.
@@ -993,15 +985,11 @@ class MessagesView extends React.Component {
seq={this.props.callSeq} seq={this.props.callSeq}
callState={this.props.callState} callState={this.props.callState}
onError={this.props.onError} onError={this.props.onError}
onClose={this.handleRtcClose} onHangup={this.handleTeleHangup}
onHangup={this.props.onTeleHangup}
onInvite={this.props.onTeleInvite} onInvite={this.props.onTeleInvite}
onSendOffer={this.props.onTeleSendOffer} onSendOffer={this.props.onTeleSendOffer}
onIceCandidate={this.props.onTeleIceCandidate} onIceCandidate={this.props.onTeleIceCandidate}
onSendAnswer={this.props.onTeleSendAnswer} onSendAnswer={this.props.onTeleSendAnswer}
//content={this.state.imagePostview}
//onClose={this.handleClosePreview}
/> />
); );
} else { } else {
@@ -1194,7 +1182,6 @@ class MessagesView extends React.Component {
</> </>
); );
} }
//<button onClick={this.handleRtcClick} >abc</button>
component = <div id="topic-view">{component2}</div> component = <div id="topic-view">{component2}</div>
} }
return component; return component;
-2
View File
@@ -309,8 +309,6 @@ export default class RtcPanel extends React.PureComponent {
handleCloseClick() { handleCloseClick() {
this.stop(); this.stop();
this.props.onHangup(this.props.topic.name, this.props.seq); this.props.onHangup(this.props.topic.name, this.props.seq);
this.props.onClose();
} }
toggleMedia(kind) { toggleMedia(kind) {