fix decision whether DM was sent by local or remote peer to mark it accordingly

This commit is contained in:
Simon Grim 2017-07-12 19:28:01 +05:00
parent 043f9e8740
commit 61872ab4eb

View File

@ -266,10 +266,10 @@ function setPostInfoSent(n, k, item) {
// format dmdata (returned by getdirectmsgs) to display in conversation thread
function postToElemDM(dmData, localUser, remoteUser) {
var senderAlias = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0))
? dmData.from : (dmData.fromMe ? localUser : remoteUser);
? dmData.from : (dmData.fromMe || dmData.from === localUser ? localUser : remoteUser);
var elem = $('#dm-chat-template').clone(true).appendTo(twister.html.detached)
.removeAttr('id')
.addClass(dmData.fromMe ? 'sent' : 'received')
.addClass(dmData.fromMe || dmData.from === localUser ? 'sent' : 'received')
;
var elemName = elem.find('.post-info-name')