auto-sync: 2026-05-28 12:47:44
This commit is contained in:
@@ -56,7 +56,7 @@ def _task_to_mail(task: Task) -> Dict[str, Any]:
|
||||
return {
|
||||
"id": task.id,
|
||||
"title": task.title,
|
||||
"from": meta.get("from", task.assigned_by),
|
||||
"from": task.assigned_by or "unknown",
|
||||
"to": task.assignee,
|
||||
"status": task.status,
|
||||
"type": meta.get("type", "inform"),
|
||||
@@ -80,15 +80,12 @@ async def list_mail(
|
||||
):
|
||||
"""Mail 列表(按时间倒序)"""
|
||||
bb = _bb()
|
||||
tasks = bb.list_tasks(status=status, assignee=to_agent)
|
||||
tasks = bb.list_tasks(status=status, assignee=to_agent, assigned_by=from_agent)
|
||||
|
||||
mails = []
|
||||
for t in tasks:
|
||||
meta = _mail_meta(t)
|
||||
# from 过滤
|
||||
if from_agent and meta.get("from", t.assigned_by) != from_agent:
|
||||
continue
|
||||
# unread 过滤
|
||||
# unread 过滤(must_haves JSON 内字段,无法 SQL WHERE)
|
||||
if unread is True and meta.get("is_read", False):
|
||||
continue
|
||||
mails.append(_task_to_mail(t))
|
||||
|
||||
Reference in New Issue
Block a user