Merge pull request #347 from sauerdaniel/polecat/nux-mail-notification-fix
Reviewed by gastown/crew/jack - clean fix using established NudgeSession pattern
This commit is contained in:
@@ -863,7 +863,7 @@ func (r *Router) GetMailbox(address string) (*Mailbox, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// notifyRecipient sends a notification to a recipient's tmux session.
|
// notifyRecipient sends a notification to a recipient's tmux session.
|
||||||
// Uses send-keys to echo a visible banner to ensure notification is seen.
|
// Uses NudgeSession to add the notification to the agent's conversation history.
|
||||||
// Supports mayor/, rig/polecat, and rig/refinery addresses.
|
// Supports mayor/, rig/polecat, and rig/refinery addresses.
|
||||||
func (r *Router) notifyRecipient(msg *Message) error {
|
func (r *Router) notifyRecipient(msg *Message) error {
|
||||||
sessionID := addressToSessionID(msg.To)
|
sessionID := addressToSessionID(msg.To)
|
||||||
@@ -877,8 +877,9 @@ func (r *Router) notifyRecipient(msg *Message) error {
|
|||||||
return nil // No active session, skip notification
|
return nil // No active session, skip notification
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send visible notification banner to the terminal
|
// Send notification to the agent's conversation history
|
||||||
return r.tmux.SendNotificationBanner(sessionID, msg.From, msg.Subject)
|
notification := fmt.Sprintf("📬 You have new mail from %s. Subject: %s. Run 'gt mail inbox' to read.", msg.From, msg.Subject)
|
||||||
|
return r.tmux.NudgeSession(sessionID, notification)
|
||||||
}
|
}
|
||||||
|
|
||||||
// addressToSessionID converts a mail address to a tmux session ID.
|
// addressToSessionID converts a mail address to a tmux session ID.
|
||||||
|
|||||||
Reference in New Issue
Block a user