Clean up a bit

pull/566/head
Beaudan Brown 6 years ago
parent 8cf90ae85d
commit 221c6b53b1

@ -666,12 +666,10 @@ class LokiPublicChannelAPI {
sigString += adnMessage.reply_to; sigString += adnMessage.reply_to;
} }
} }
attachmentAnnotations sigString += [...attachmentAnnotations, ...previewAnnotations]
.concat(previewAnnotations)
.map(data => data.id || data.image.id) .map(data => data.id || data.image.id)
.sort() .sort()
// eslint-disable-next-line no-return-assign .join();
.forEach(id => sigString += id);
sigString += sigVer; sigString += sigVer;
return dcodeIO.ByteBuffer.wrap(sigString, 'utf8').toArrayBuffer(); return dcodeIO.ByteBuffer.wrap(sigString, 'utf8').toArrayBuffer();
} }
@ -858,8 +856,8 @@ class LokiPublicChannelAPI {
receivedAt, receivedAt,
isPublic: true, isPublic: true,
message: { message: {
// == to compare string and number body:
body: adnMessage.text == timestamp ? '' : adnMessage.text, adnMessage.text === timestamp.toString() ? '' : adnMessage.text,
attachments, attachments,
group: { group: {
id: this.conversationId, id: this.conversationId,
@ -901,8 +899,8 @@ class LokiPublicChannelAPI {
caption: annotation.value.caption, caption: annotation.value.caption,
contentType: annotation.value.contentType, contentType: annotation.value.contentType,
digest: annotation.value.digest, digest: annotation.value.digest,
fileName: annotation.value.fileName || '', fileName: annotation.value.fileName,
flags: annotation.value.flags || '0', flags: annotation.value.flags,
height: annotation.value.height, height: annotation.value.height,
id: annotation.value.id, id: annotation.value.id,
key: annotation.value.key, key: annotation.value.key,
@ -929,8 +927,8 @@ class LokiPublicChannelAPI {
caption: preview.image.caption, caption: preview.image.caption,
contentType: preview.image.contentType, contentType: preview.image.contentType,
digest: preview.image.digest, digest: preview.image.digest,
fileName: preview.image.fileName || '', fileName: preview.image.fileName,
flags: preview.image.flags || '0', flags: preview.image.flags,
height: preview.image.height, height: preview.image.height,
id: preview.image.id, id: preview.image.id,
key: preview.image.key, key: preview.image.key,

Loading…
Cancel
Save