thread fix

This commit is contained in:
debu-2 2026-10-06 04:42:47 +05:30
parent d58fb8841b
commit a58ba11566
11 changed files with 177 additions and 30 deletions

View file

@ -17,6 +17,7 @@ from app.services.message_ids import (
message_id_fields,
)
from app.services.mime_parser import parse_mime
from app.services.reply_extractor import build_reply_display
from app.services.raw_mime_storage import get_raw_mime_storage
from app.services.thread_service import threading_fields_from_parent
@ -410,6 +411,10 @@ async def send_external_reply(
)
now = datetime.now(timezone.utc)
reply_display = build_reply_display(
body_text=plan.body_text,
body_html=plan.body_html,
)
document = {
"direction": "outbound",
"message_scope": MESSAGE_SCOPE_EXTERNAL,
@ -417,7 +422,10 @@ async def send_external_reply(
"sender": {"name": sender_name, "address": sender},
"to": [{"name": value.split("@")[0], "address": value} for value in plan.recipients],
"subject": plan.subject,
"snippet": re.sub(r"\s+", " ", plan.body_text).strip()[:240],
"snippet": reply_display["snippet"],
"new_reply_content": reply_display["new_reply_content"],
"quoted_content": reply_display["quoted_content"],
"has_quoted_text": reply_display["has_quoted_text"],
"body_text": plan.body_text,
"body_html": plan.body_html,
"attachments": [],