diff --git a/package.json b/package.json index ffa61da21..7a4f72254 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "abort-controller": "3.0.0", "auto-bind": "^4.0.0", "backbone": "1.3.3", - "better-sqlite3": "https://github.com/signalapp/better-sqlite3#2fa02d2484e9f9a10df5ac7ea4617fb2dff30006", + "better-sqlite3": "https://github.com/signalapp/better-sqlite3#ad0db5dd09c0ea4007b1c46bd4f7273827803347", "blob-util": "1.3.0", "blueimp-canvas-to-blob": "3.14.0", "blueimp-load-image": "2.18.0", 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'; diff --git a/ts/receiver/callMessage.ts b/ts/receiver/callMessage.ts index 47fc25600..bec8f2f6b 100644 --- a/ts/receiver/callMessage.ts +++ b/ts/receiver/callMessage.ts @@ -2,12 +2,10 @@ import _ from 'lodash'; import { SignalService } from '../protobuf'; import { TTL_DEFAULT } from '../session/constants'; import { SNodeAPI } from '../session/snode_api'; -import { CallManager } from '../session/utils'; +import { CallManager, UserUtils } from '../session/utils'; import { removeFromCache } from './cache'; import { EnvelopePlus } from './types'; -// audric FIXME: refactor this out to persistence, just to help debug the flow and send/receive in synchronous testing - export async function handleCallMessage( envelope: EnvelopePlus, callMessage: SignalService.CallMessage 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; } diff --git a/yarn.lock b/yarn.lock index 11f13bf5c..b66dbbada 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2180,9 +2180,9 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -"better-sqlite3@https://github.com/signalapp/better-sqlite3#2fa02d2484e9f9a10df5ac7ea4617fb2dff30006": +"better-sqlite3@https://github.com/signalapp/better-sqlite3#ad0db5dd09c0ea4007b1c46bd4f7273827803347": version "7.1.4" - resolved "https://github.com/signalapp/better-sqlite3#2fa02d2484e9f9a10df5ac7ea4617fb2dff30006" + resolved "https://github.com/signalapp/better-sqlite3#ad0db5dd09c0ea4007b1c46bd4f7273827803347" dependencies: bindings "^1.5.0" tar "^6.1.0"