From 378d3cd569e12d8ce0ac80e593d20ccb5af95352 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 22 Dec 2025 23:57:55 -0800 Subject: [PATCH] Fix: Self-mail should suppress tmux notification (gt-utwc) --- internal/mail/router.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/mail/router.go b/internal/mail/router.go index eb20b71a..e2481b50 100644 --- a/internal/mail/router.go +++ b/internal/mail/router.go @@ -141,11 +141,22 @@ func (r *Router) Send(msg *Message) error { } // Notify recipient if they have an active session - _ = r.notifyRecipient(msg) + // Skip notification for self-mail (handoffs to future-self don't need present-self notified) + if !isSelfMail(msg.From, msg.To) { + _ = r.notifyRecipient(msg) + } return nil } +// isSelfMail returns true if sender and recipient are the same identity. +// Normalizes addresses by removing trailing slashes for comparison. +func isSelfMail(from, to string) bool { + fromNorm := strings.TrimSuffix(from, "/") + toNorm := strings.TrimSuffix(to, "/") + return fromNorm == toNorm +} + // GetMailbox returns a Mailbox for the given address. // Routes to the correct beads database based on the address. func (r *Router) GetMailbox(address string) (*Mailbox, error) {