mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-13 08:27:51 +00:00
display group chat sender's avatar properly
This commit is contained in:
parent
fb71afd78f
commit
70a43d18d2
@ -166,11 +166,14 @@ function dmDataToSnippetItem(dmData, remoteUser) {
|
||||
|
||||
// format dmdata (returned by getdirectmsgs) to display in conversation thread
|
||||
function dmDataToConversationItem(dmData, localUser, remoteUser) {
|
||||
var from = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0))
|
||||
? dmData.from
|
||||
: (dmData.fromMe ? localUser : remoteUser);
|
||||
var classDm = dmData.fromMe ? "sent" : "received";
|
||||
var dmItem = $("#dm-chat-template").clone(true);
|
||||
dmItem.removeAttr('id');
|
||||
dmItem.addClass(classDm);
|
||||
getAvatar(dmData.fromMe ? localUser : remoteUser, dmItem.find(".post-photo").find("img") );
|
||||
getAvatar(from, dmItem.find(".post-photo").find("img") );
|
||||
dmItem.find(".post-info-time").text(timeGmtToText(dmData.time)).attr("title",timeSincePost(dmData.time));
|
||||
var mentions = [];
|
||||
dmItem.find('.post-text').html(htmlFormatMsg(dmData.text, mentions));
|
||||
|
Loading…
Reference in New Issue
Block a user