Move video call message state and duration to head.

'webrtc' header for state.
'webrtc-duration' header for duration.

Content is now Drafty.videoCall() / VC.
This commit is contained in:
aforge
2022-05-29 15:29:13 +03:00
parent df460c6b61
commit 3c87341280
13 changed files with 476 additions and 641 deletions
+2 -8
View File
@@ -1137,20 +1137,14 @@ class MessagesView extends React.Component {
);
prevDate = thisDate;
}
let duration;
if (msg.head && isVideoCall(msg.head.mime)) {
topic.messageVersions(msg, (cur, before) => {
if (cur.content == 'finished' && before.content == 'accepted') {
duration = msg.ts - before.ts;
}
});
}
const duration = msg.head ? msg.head['webrtc-duration'] : undefined;
messageNodes.push(
<ChatMessage
tinode={this.props.tinode}
content={msg.content}
mimeType={msg.head ? msg.head.mime : null}
timestamp={msg.ts}
callState={msg.head ? msg.head.webrtc : null}
duration={duration}
response={isReply}
seq={msg.seq}