pull avatar out of annotation, put it in profile

pull/638/head
Ryan Tharp 6 years ago
parent 207e3d022f
commit 3508658e00

@ -923,7 +923,6 @@ class LokiPublicChannelAPI {
quote, quote,
attachments, attachments,
preview, preview,
avatar,
} = messengerData; } = messengerData;
if (!timestamp) { if (!timestamp) {
return false; // Invalid message return false; // Invalid message
@ -959,7 +958,6 @@ class LokiPublicChannelAPI {
].splice(-5); ].splice(-5);
const from = adnMessage.user.name || 'Anonymous'; // profileName const from = adnMessage.user.name || 'Anonymous'; // profileName
const avatarObj = avatar || null;
// track sources for multidevice support // track sources for multidevice support
// sort it by home server // sort it by home server
@ -1015,8 +1013,7 @@ class LokiPublicChannelAPI {
contact: [], contact: [],
preview, preview,
profile: { profile: {
displayName: from, displayName: from
avatar: avatarObj,
}, },
}, },
}; };
@ -1075,7 +1072,8 @@ class LokiPublicChannelAPI {
if (slavePrimaryMap[messageData.source]) { if (slavePrimaryMap[messageData.source]) {
// pop primary device avatars in // pop primary device avatars in
if (avatarMap[slavePrimaryMap[messageData.source]]) { if (avatarMap[slavePrimaryMap[messageData.source]]) {
// modify messageData for user's avatar? // modify messageData for user's avatar
messageData.profile.avatar=avatarMap[slavePrimaryMap[messageData.source]];
} }
// delay sending the message // delay sending the message
@ -1089,7 +1087,8 @@ class LokiPublicChannelAPI {
// pop current device avatars in // pop current device avatars in
if (avatarMap[messageData.source]) { if (avatarMap[messageData.source]) {
// modify messageData for user's avatar? // modify messageData for user's avatar
messageData.profile.avatar=avatarMap[messageData.source];
} }
// send event now // send event now
@ -1245,7 +1244,6 @@ class LokiPublicChannelAPI {
type: 'network.loki.messenger.publicChat', type: 'network.loki.messenger.publicChat',
value: { value: {
timestamp: messageTimeStamp, timestamp: messageTimeStamp,
avatar: avatarAnnotation,
}, },
}, },
...attachmentAnnotations, ...attachmentAnnotations,

Loading…
Cancel
Save