From 4c108b470bc095eaa877215031eecf7a4b6dc343 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 10 Jul 2020 16:29:24 +1000 Subject: [PATCH 1/3] hide ourdevices when creating a closed group --- ts/components/session/SessionClosableOverlay.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/components/session/SessionClosableOverlay.tsx b/ts/components/session/SessionClosableOverlay.tsx index b70853766..a6ca82b3e 100644 --- a/ts/components/session/SessionClosableOverlay.tsx +++ b/ts/components/session/SessionClosableOverlay.tsx @@ -74,7 +74,7 @@ export class SessionClosableOverlay extends React.Component { overlayMode === SessionClosableOverlayType.ClosedGroup; if (isClosedGroupView) { filteredContactsList = filteredContactsList.filter( - c => c.type === 'direct' + c => c.type === 'direct' && !c.isMe ); } From c7daf55a65175af7538e3b053dabc2471a410e8e Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 10 Jul 2020 17:18:18 +1000 Subject: [PATCH 2/3] close overlay when open group is joined --- ts/components/session/LeftPaneMessageSection.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ts/components/session/LeftPaneMessageSection.tsx b/ts/components/session/LeftPaneMessageSection.tsx index d634e46ba..9b33e50cf 100644 --- a/ts/components/session/LeftPaneMessageSection.tsx +++ b/ts/components/session/LeftPaneMessageSection.tsx @@ -511,6 +511,7 @@ export class LeftPaneMessageSection extends React.Component { this.setState({ loading: false, }); + this.handleToggleOverlay(undefined); } } From a4fedaf75d1c5a0f0d9cf10abbfbdec90f04e46a Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 13 Jul 2020 09:07:52 +1000 Subject: [PATCH 3/3] fix empty avatar being undefined rather than '' building ClosedGroupUpdate message via ts makes it have an avatar content with fields empty if we pass '' as avatar. we wamt no avatar field at all --- js/background.js | 4 ++-- .../content/data/group/ClosedGroupUpdateMessage.ts | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/js/background.js b/js/background.js index 20ec8003f..f1a80de6f 100644 --- a/js/background.js +++ b/js/background.js @@ -700,7 +700,7 @@ return; } - const nullAvatar = ''; + const nullAvatar = undefined; if (avatar) { // would get to download this file on each client in the group // and reference the local file @@ -831,7 +831,7 @@ recipients: allMembers, active: true, expireTimer: 0, - avatar: '', + avatar: undefined, }, confirm: () => {}, }; diff --git a/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts b/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts index 612f69eee..0664a0516 100644 --- a/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts +++ b/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts @@ -43,6 +43,13 @@ export abstract class ClosedGroupUpdateMessage extends ClosedGroupMessage { throw new Error('admins has not the correct type'); } + if ( + params.avatar !== undefined && + !(params.avatar instanceof SignalService.AttachmentPointer) + ) { + throw new Error('avatar has not the correct type'); + } + this.name = params.name; this.members = params.members; this.admins = params.admins;