fix(im): add toId/chatType filters to MessageSearchParams and searchMessages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
21f27c1770
当前提交
afe13d1c90
@ -20,6 +20,8 @@ function conversationId(appId: string, userId: string, targetId: string, chatTyp
|
||||
|
||||
export interface MessageSearchParams {
|
||||
keyword?: string
|
||||
toId?: string
|
||||
chatType?: string
|
||||
startTime?: number
|
||||
endTime?: number
|
||||
msgTypes?: string[]
|
||||
@ -165,6 +167,12 @@ export const ImDatabase = {
|
||||
Q.where('app_id', appId),
|
||||
]
|
||||
|
||||
if (params.toId) {
|
||||
conditions.push(Q.where('to_id', params.toId))
|
||||
}
|
||||
if (params.chatType) {
|
||||
conditions.push(Q.where('chat_type', params.chatType))
|
||||
}
|
||||
if (params.keyword) {
|
||||
conditions.push(Q.where('content', Q.like(`%${Q.sanitizeLikeString(params.keyword)}%`)))
|
||||
}
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户