From 1d3a89f05809d7f5c1c7946b3784f3b180eb16a3 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 17 Nov 2021 10:22:54 +1100 Subject: [PATCH 1/2] hide activeAt = 0 convo from search results Fixes #2033 --- ts/state/selectors/search.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ts/state/selectors/search.ts b/ts/state/selectors/search.ts index c0f60b067..e60a3cc2f 100644 --- a/ts/state/selectors/search.ts +++ b/ts/state/selectors/search.ts @@ -44,8 +44,9 @@ export const getSearchResults = createSelector( state.conversations.map(id => { const value = lookup[id]; - // Don't return anything when activeAt is undefined (i.e. no current conversations with this user) - if (value.activeAt === undefined) { + // Don't return anything when activeAt is unset (i.e. no current conversations with this user) + if (value.activeAt === undefined || value.activeAt === 0) { + //activeAt can be 0 when linking device return null; } From 465508b2ae610dabf5ae11b03523d2b2b9b3df13 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 17 Nov 2021 10:37:40 +1100 Subject: [PATCH 2/2] opengroup messages from blocked user are dropped Fixes #2019 --- ts/opengroup/opengroupV2/ApiUtil.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/opengroup/opengroupV2/ApiUtil.ts b/ts/opengroup/opengroupV2/ApiUtil.ts index 56993469d..bb345ce1f 100644 --- a/ts/opengroup/opengroupV2/ApiUtil.ts +++ b/ts/opengroup/opengroupV2/ApiUtil.ts @@ -3,6 +3,7 @@ import { FileServerV2Request } from '../../fileserver/FileServerApiV2'; import { PubKey } from '../../session/types'; import { allowOnlyOneAtATime } from '../../session/utils/Promise'; import { updateDefaultRooms, updateDefaultRoomsInProgress } from '../../state/ducks/defaultRooms'; +import { BlockedNumberController } from '../../util'; import { getCompleteUrlFromRoom } from '../utils/OpenGroupUtils'; import { parseOpenGroupV2 } from './JoinOpenGroupV2'; import { getAllRoomInfos } from './OpenGroupAPIV2'; @@ -100,7 +101,11 @@ export const parseMessages = async ( } } - return _.compact(parsedMessages).sort((a, b) => (a.serverId || 0) - (b.serverId || 0)); + return _.compact( + parsedMessages.map(m => + m && m.sender && !BlockedNumberController.isBlocked(m.sender) ? m : null + ) + ).sort((a, b) => (a.serverId || 0) - (b.serverId || 0)); }; // tslint:disable: no-http-string const defaultServerUrl = 'http://116.203.70.33';