received marker in message previews

This commit is contained in:
or-else
2021-01-19 18:50:18 -08:00
parent 4445a90437
commit 1f5a76e481
10 changed files with 125 additions and 69 deletions
+9 -4
View File
@@ -77,11 +77,15 @@ class ContactList extends React.Component {
const comment = Array.isArray(c.private) ?
c.private.join(',') : (c.private ? c.private.comment : null);
let preview;
let deliveryStatus;
if (!this.props.showMode) {
const content = (c.latestMessage() || { content: '' }).content;
preview = typeof content == 'string' ?
content.substr(0, MESSAGE_PREVIEW_LENGTH) :
Drafty.preview(content, MESSAGE_PREVIEW_LENGTH);
const msg = c.latestMessage();
if (msg) {
deliveryStatus = c.msgStatus(msg);
preview = typeof msg.content == 'string' ?
msg.content.substr(0, MESSAGE_PREVIEW_LENGTH) :
Drafty.preview(msg.content, MESSAGE_PREVIEW_LENGTH);
}
}
contactNodes.push(
<Contact
@@ -89,6 +93,7 @@ class ContactList extends React.Component {
avatar={makeImageUrl(c.public ? c.public.photo : null)}
comment={comment}
preview={preview}
received={deliveryStatus}
unread={this.props.showUnread ? c.unread : 0}
now={c.online && this.props.connected}
acs={c.acs}