Restore contact/conversation differentiation in search results
This commit is contained in:
parent
0fc178d887
commit
c147e6ce25
2 changed files with 9 additions and 3 deletions
|
@ -15,6 +15,12 @@ import { AttachmentType } from '../../types/Attachment';
|
|||
|
||||
// State
|
||||
|
||||
export type DBConversationType = {
|
||||
id: string;
|
||||
activeAt?: number;
|
||||
lastMessage: string;
|
||||
type: string;
|
||||
};
|
||||
export type ConversationType = {
|
||||
id: string;
|
||||
name?: string;
|
||||
|
|
|
@ -11,8 +11,8 @@ import {
|
|||
import { makeLookup } from '../../util/makeLookup';
|
||||
|
||||
import {
|
||||
ConversationType,
|
||||
ConversationUnloadedActionType,
|
||||
DBConversationType,
|
||||
MessageDeletedActionType,
|
||||
MessageType,
|
||||
RemoveAllConversationsActionType,
|
||||
|
@ -276,7 +276,7 @@ async function queryConversationsAndContacts(
|
|||
const { ourNumber, noteToSelf } = options;
|
||||
const query = providedQuery.replace(/[+-.()]*/g, '');
|
||||
|
||||
const searchResults: Array<ConversationType> = await dataSearchConversations(
|
||||
const searchResults: Array<DBConversationType> = await dataSearchConversations(
|
||||
query
|
||||
);
|
||||
|
||||
|
@ -287,7 +287,7 @@ async function queryConversationsAndContacts(
|
|||
for (let i = 0; i < max; i += 1) {
|
||||
const conversation = searchResults[i];
|
||||
|
||||
if (conversation.type === 'direct' && !Boolean(conversation.lastMessage)) {
|
||||
if (conversation.type === 'private' && !Boolean(conversation.lastMessage)) {
|
||||
contacts.push(conversation.id);
|
||||
} else {
|
||||
conversations.push(conversation.id);
|
||||
|
|
Loading…
Add table
Reference in a new issue