Merge pull request #1527 from oxen-io/clearnet

Session v1.4.11
pull/1546/head
Audric Ackermann 4 years ago committed by GitHub
commit 7e83aa3baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
"name": "session-desktop", "name": "session-desktop",
"productName": "Session", "productName": "Session",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"version": "1.4.10", "version": "1.4.11",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Loki Project", "name": "Loki Project",

@ -98,33 +98,16 @@ export class ChatMessage extends DataMessage {
) { ) {
if ( if (
(dataMessage as any).constructor.name !== 'DataMessage' && (dataMessage as any).constructor.name !== 'DataMessage' &&
!(dataMessage instanceof DataMessage) !(dataMessage instanceof SignalService.DataMessage)
) { ) {
throw new Error( window.log.warn(
'Tried to build a sync message from something else than a DataMessage' 'buildSyncMessage with something else than a DataMessage'
); );
} }
if (!sentTimestamp || !isNumber(sentTimestamp)) { if (!sentTimestamp || !isNumber(sentTimestamp)) {
throw new Error('Tried to build a sync message without a sentTimestamp'); throw new Error('Tried to build a sync message without a sentTimestamp');
} }
// the dataMessage.profileKey is of type ByteBuffer. We need to make it a Uint8Array
const lokiProfile: any = {};
if (dataMessage.profileKey?.length) {
lokiProfile.profileKey = new Uint8Array(
(dataMessage.profileKey as any).toArrayBuffer()
);
}
if (dataMessage.profile) {
if (dataMessage.profile?.displayName) {
lokiProfile.displayName = dataMessage.profile.displayName;
}
if (dataMessage.profile?.profilePicture) {
lokiProfile.avatarPointer = dataMessage.profile.profilePicture;
}
}
const timestamp = toNumber(sentTimestamp); const timestamp = toNumber(sentTimestamp);
const body = dataMessage.body || undefined; const body = dataMessage.body || undefined;
const attachments = (dataMessage.attachments || []).map(attachment => { const attachments = (dataMessage.attachments || []).map(attachment => {
@ -147,7 +130,6 @@ export class ChatMessage extends DataMessage {
attachments, attachments,
body, body,
quote, quote,
lokiProfile,
preview, preview,
syncTarget, syncTarget,
}); });

Loading…
Cancel
Save