From e052a6743ac5e5cecdf2a187757dcf0e286d12fd Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 1 Mar 2021 16:38:40 +1100 Subject: [PATCH 1/3] fix building of sync message from 1-to-1 convo --- ts/session/messages/outgoing/content/data/ChatMessage.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/session/messages/outgoing/content/data/ChatMessage.ts b/ts/session/messages/outgoing/content/data/ChatMessage.ts index fcd5ad6f4..8ae6330c3 100644 --- a/ts/session/messages/outgoing/content/data/ChatMessage.ts +++ b/ts/session/messages/outgoing/content/data/ChatMessage.ts @@ -98,10 +98,10 @@ export class ChatMessage extends DataMessage { ) { if ( (dataMessage as any).constructor.name !== 'DataMessage' && - !(dataMessage instanceof DataMessage) + !(dataMessage instanceof SignalService.DataMessage) ) { - throw new Error( - 'Tried to build a sync message from something else than a DataMessage' + window.log.warn( + 'buildSyncMessage with something else than a DataMessage' ); } From b8a17bcd94e7800f400306b646b096202c72e329 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 1 Mar 2021 16:46:16 +1100 Subject: [PATCH 2/3] do not include lokiProfile on sync Message => we use ConfigMessage now --- .../outgoing/content/data/ChatMessage.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/ts/session/messages/outgoing/content/data/ChatMessage.ts b/ts/session/messages/outgoing/content/data/ChatMessage.ts index 8ae6330c3..628bbd4c0 100644 --- a/ts/session/messages/outgoing/content/data/ChatMessage.ts +++ b/ts/session/messages/outgoing/content/data/ChatMessage.ts @@ -108,23 +108,6 @@ export class ChatMessage extends DataMessage { if (!sentTimestamp || !isNumber(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 body = dataMessage.body || undefined; const attachments = (dataMessage.attachments || []).map(attachment => { @@ -147,7 +130,6 @@ export class ChatMessage extends DataMessage { attachments, body, quote, - lokiProfile, preview, syncTarget, }); From 7b894b1a9030a406caa6a27ab4246ec03eddf3c4 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 2 Mar 2021 11:28:55 +1100 Subject: [PATCH 3/3] bump to v1.4.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5de4d199..c1f9c26ee 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.4.10", + "version": "1.4.11", "license": "GPL-3.0", "author": { "name": "Loki Project",