refac
This commit is contained in:
@@ -892,6 +892,7 @@ async def search_chats(
|
|||||||
end_timestamp: Optional[int] = None,
|
end_timestamp: Optional[int] = None,
|
||||||
__request__: Request = None,
|
__request__: Request = None,
|
||||||
__user__: dict = None,
|
__user__: dict = None,
|
||||||
|
__chat_id__: str = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
"""
|
"""
|
||||||
Search the user's previous chat conversations by title and message content.
|
Search the user's previous chat conversations by title and message content.
|
||||||
@@ -921,6 +922,10 @@ async def search_chats(
|
|||||||
|
|
||||||
results = []
|
results = []
|
||||||
for chat in chats:
|
for chat in chats:
|
||||||
|
# Skip the current chat to avoid showing it in search results
|
||||||
|
if __chat_id__ and chat.id == __chat_id__:
|
||||||
|
continue
|
||||||
|
|
||||||
# Apply date filters (updated_at is in seconds)
|
# Apply date filters (updated_at is in seconds)
|
||||||
if start_timestamp and chat.updated_at < start_timestamp:
|
if start_timestamp and chat.updated_at < start_timestamp:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user