More UI tweaks (calls).
1. Localize video call messages. 2. Display call message previews correctly.
This commit is contained in:
@@ -10,6 +10,7 @@ import Contact from './contact.jsx';
|
||||
import ContactAction from './contact-action.jsx';
|
||||
|
||||
import { makeImageUrl } from '../lib/blob-helpers.js';
|
||||
import { isVideoCall } from '../lib/utils.js'
|
||||
|
||||
import { MESSAGE_PREVIEW_LENGTH } from '../config.js';
|
||||
|
||||
@@ -78,12 +79,16 @@ class ContactList extends React.Component {
|
||||
c.private.join(',') : (c.private ? c.private.comment : null);
|
||||
let preview;
|
||||
let forwarded;
|
||||
let previewIsVideoCall;
|
||||
let previewIsResponse;
|
||||
let deliveryStatus;
|
||||
if (!this.props.showMode && c.latestMessage) {
|
||||
const msg = c.latestMessage(true);
|
||||
if (msg) {
|
||||
forwarded = msg.head ? msg.head.forwarded : null;
|
||||
deliveryStatus = msg._status || c.msgStatus(msg, true);
|
||||
previewIsVideoCall = msg.head ? isVideoCall(msg.head.mime) : null;
|
||||
previewIsResponse = msg.from != this.props.myUserId;
|
||||
if (msg.content) {
|
||||
preview = typeof msg.content == 'string' ?
|
||||
msg.content.substr(0, MESSAGE_PREVIEW_LENGTH) :
|
||||
@@ -99,6 +104,8 @@ class ContactList extends React.Component {
|
||||
avatar={makeImageUrl(c.public ? c.public.photo : null)}
|
||||
comment={comment}
|
||||
preview={preview}
|
||||
previewIsVideoCall={previewIsVideoCall}
|
||||
previewIsResponse={previewIsResponse}
|
||||
forwarded={forwarded}
|
||||
received={deliveryStatus}
|
||||
unread={this.props.showUnread ? c.unread : 0}
|
||||
|
||||
Reference in New Issue
Block a user