diff --git a/bot/chorus_bot/cogs/email_ingest.py b/bot/chorus_bot/cogs/email_ingest.py index 6030342..4379d36 100644 --- a/bot/chorus_bot/cogs/email_ingest.py +++ b/bot/chorus_bot/cogs/email_ingest.py @@ -9,13 +9,6 @@ from chorus_bot.ping import build_ping_embed SEEN_UIDS_PATH = Path(os.environ.get("CHORUS_SEEN_UIDS_PATH", "seen_uids.json")) -# Discord embed field values cap at 1024 chars. Truncate the raw_content we pass -# into the embed with headroom below that cap for build_ping_embed's own -# truncation marker (see ping.py). This is intentionally lossy for very long -# emails -- acceptable for MVP; the full body still lives in the source mailbox. -_RAW_CONTENT_MAX = 1000 -_TRUNCATION_MARKER = "\n\n[...truncated for Discord embed limit...]" - # modality -> (imap host attr, imap user attr, imap password attr) on Config MAILBOXES = { "bh_email": ("bh_email_imap_host", "bh_email_imap_user", "bh_email_imap_password"), @@ -80,7 +73,7 @@ class EmailIngestCog(commands.Cog): captured_at = parsedate_to_datetime(msg.get("Date")) body = self._extract_body(msg) snippet = body if len(body) <= 120 else body[:117] + "..." - raw_content = self._truncate_for_embed(body) + raw_content = body embed = build_ping_embed( modality=modality, sender_id=sender, snippet=snippet, @@ -95,15 +88,6 @@ class EmailIngestCog(commands.Cog): finally: conn.logout() - @staticmethod - def _truncate_for_embed(body: str) -> str: - """Cap the raw_content passed into the embed at a safe length below - Discord's 1024-char field limit. Lossy for very long emails but keeps - ingestion from failing (and retrying forever) on oversized bodies.""" - if len(body) <= _RAW_CONTENT_MAX: - return body - return body[:_RAW_CONTENT_MAX] + _TRUNCATION_MARKER - @staticmethod def _extract_body(msg) -> str: if msg.is_multipart(): diff --git a/bot/chorus_bot/cogs/thread_ingest.py b/bot/chorus_bot/cogs/thread_ingest.py index cb0a5aa..717c608 100644 --- a/bot/chorus_bot/cogs/thread_ingest.py +++ b/bot/chorus_bot/cogs/thread_ingest.py @@ -33,7 +33,7 @@ class ThreadIngestCog(commands.Cog): sender_id=parsed["sender_id"], ) await thread.send( - "Logged in Chorus — open the app to fill in details and track this one." + "Logged in Chorus - open the app to fill in details and track this one." )