exclude ids from search entry

This commit is contained in:
Audric Ackermann 2022-02-02 17:50:59 +11:00
parent d6a8f5e92b
commit 07a1beae5e
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
2 changed files with 5 additions and 4 deletions

View File

@ -1837,15 +1837,13 @@ function searchConversations(query, { limit } = {}) {
.prepare(
`SELECT json FROM ${CONVERSATIONS_TABLE} WHERE
(
id LIKE $id OR
name LIKE $name OR
profileName LIKE $profileName
) AND active_at IS NOT NULL AND active_at > 0
ORDER BY id ASC
ORDER BY active_at DESC
LIMIT $limit`
)
.all({
id: `%${query}%`,
name: `%${query}%`,
profileName: `%${query}%`,
limit: limit || 50,
@ -2322,6 +2320,9 @@ function getLastMessagesByConversation(conversationId, limit) {
return map(rows, row => jsonToObject(row.json));
}
/**
* This is the oldest message so we cannot reuse getLastMessagesByConversation
*/
function getOldestMessageInConversation(conversationId) {
const rows = globalInstance
.prepare(

View File

@ -37,7 +37,7 @@ export function useConversationUsernameOrShorten(convoId?: string) {
export function useConversationRealName(convoId?: string) {
const convoProps = useConversationPropsById(convoId);
return convoProps?.name;
return convoProps?.isPrivate ? convoProps?.name : undefined;
}
/**