feat(message): implement message search functionality
Add ability to search messages within a specific conversation. This includes: - New `MessageSearchScreen` for displaying search results. - `MessageRepository.searchByConversation` to query messages by keyword and conversation ID. - Integration of search entry points in `GroupInfoScreen` and `PrivateChatInfoScreen`. - Support for scrolling to a specific message sequence (`scrollToSeq`) when navigating from search results. - Enhanced `HighlightText` component to support custom highlight styles. feat(message): implement message search functionality
This commit is contained in:
@@ -87,14 +87,16 @@ export function hrefChat(params: {
|
||||
groupId?: string;
|
||||
groupName?: string;
|
||||
groupAvatar?: string;
|
||||
scrollToSeq?: number;
|
||||
}): string {
|
||||
const { conversationId, userId, isGroupChat, groupId, groupName, groupAvatar } = params;
|
||||
const { conversationId, userId, isGroupChat, groupId, groupName, groupAvatar, scrollToSeq } = params;
|
||||
const q = new URLSearchParams();
|
||||
if (userId) q.set('userId', userId);
|
||||
if (isGroupChat) q.set('isGroupChat', '1');
|
||||
if (groupId != null && groupId !== '') q.set('groupId', String(groupId));
|
||||
if (groupName) q.set('groupName', groupName);
|
||||
if (groupAvatar) q.set('groupAvatar', groupAvatar);
|
||||
if (scrollToSeq != null) q.set('scrollToSeq', String(scrollToSeq));
|
||||
const qs = q.toString();
|
||||
return `/chat/${encodeURIComponent(conversationId)}${qs ? `?${qs}` : ''}`;
|
||||
}
|
||||
@@ -131,6 +133,19 @@ export function hrefGroupInviteDetail(message: SystemMessageResponse): string {
|
||||
return `/group/invite?messageId=${encodeURIComponent(message.id)}`;
|
||||
}
|
||||
|
||||
export function hrefMessageSearch(params: {
|
||||
conversationId: string;
|
||||
conversationName?: string;
|
||||
isGroupChat?: boolean;
|
||||
}): string {
|
||||
const q = new URLSearchParams({
|
||||
conversationId: params.conversationId,
|
||||
});
|
||||
if (params.conversationName) q.set('conversationName', params.conversationName);
|
||||
if (params.isGroupChat) q.set('isGroupChat', '1');
|
||||
return `/chat/message-search?${q.toString()}`;
|
||||
}
|
||||
|
||||
export function hrefPrivateChatInfo(params: {
|
||||
conversationId: string;
|
||||
userId: string;
|
||||
|
||||
Reference in New Issue
Block a user