diff --git a/index.html b/index.html index d210c9db..8cfd6f7c 100644 --- a/index.html +++ b/index.html @@ -3364,15 +3364,7 @@ /* END InfoView */ /* BEGIN Conversation panel */ - var Received = { - UNDEF: -2, - SENDING: -1, - SERVER: 0, - CLIENT: 1, - READ: 2 - }; - - class Message extends React.Component { + class ChatMessage extends React.Component { constructor(props) { super(props); @@ -3502,18 +3494,20 @@ /* Received/read indicator */ class ReceivedMarker extends React.PureComponent { render() { - var timestamp = (this.props.received === Received.SENDING) ? + console.log("Message status:", this.props.received); + + var timestamp = (this.props.received == Tinode.MESSAGE_STATUS_PENDING) ? "sending ..." : shortDateFormat(this.props.timestamp); - var marker = null; - if (this.props.received === Received.SENDING) { + var marker = null; + if (this.props.received == Tinode.MESSAGE_STATUS_PENDING) { marker = (access_time); // watch face - } else if (this.props.received === Received.SERVER) { + } else if (this.props.received == Tinode.MESSAGE_STATUS_SENT) { marker = (done); // checkmark - } else if (this.props.received === Received.CLIENT) { + } else if (this.props.received == Tinode.MESSAGE_STATUS_RECEIVED) { marker = (done_all); // double checkmark - } else if (this.props.received === Received.READ) { + } else if (this.props.received == Tinode.MESSAGE_STATUS_READ) { marker = (done_all); // open eye } @@ -3974,16 +3968,8 @@ previousFrom = msg.from; var isReply = !(msg.from === this.props.myUserId); - var msgReceived = Received.UNDEF; - if (!isReply) { - if (topic.msgReadCount(msg.seq) > 0) { - msgReceived = Received.READ; - } else if (topic.msgRecvCount(msg.seq) > 0) { - msgReceived = Received.CLIENT; - } else { - msgReceived = Received.SERVER; - } - } + var msgDeliveryStatus = topic.msgStatus(msg); + var userName, userAvatar, userFrom, chatBoxClass; if (groupTopic) { var user = topic.userDesc(msg.from); @@ -3998,10 +3984,10 @@ } messageNodes.push( -