From 59a7b5b488095d05251a7d169896d6ef3f012bd7 Mon Sep 17 00:00:00 2001 From: pdxlocations Date: Fri, 24 Jul 2026 09:13:24 -0700 Subject: [PATCH] Fix reply sender extraction to handle missing sender gracefully --- contact/utilities/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contact/utilities/utils.py b/contact/utilities/utils.py index 41f09d5..662020a 100644 --- a/contact/utilities/utils.py +++ b/contact/utilities/utils.py @@ -179,7 +179,7 @@ def build_reply_prefix(prefix: str, message: str) -> str: else: sender_text = re.sub(r"^(?:>>|<<)\s*(?:\[[^]]+\]\s*)?", "", sender_text) sender_match = re.search(r"(.+?)\s*:\s*$", sender_text) - sender = sender_match.group(1).strip() if sender_match else "me" + sender = sender_match.group(1).strip() if sender_match else "" message_without_reply_marker = re.sub(r"^]*>\s*", "", message.replace("\x00", "")) excerpt = " ".join(message_without_reply_marker.split())[:REPLY_EXCERPT_LENGTH] return f" "