Documentation
¶
Overview ¶
Package notify announces new mail on the desktop (docs/design/desktop.md, Notifications): the texts (notes.go) and, later, the D-Bus sender.
Index ¶
- Constants
- func Broadcast(publish func([]api.EventEnvelope)) func(ctx context.Context, accountID int64, mail []Mail) error
- type Desktop
- func (d *Desktop) Announce(ctx context.Context, accountID int64, mail []Mail) error
- func (d *Desktop) Close() error
- func (d *Desktop) OnReminder(f func(id, action string))
- func (d *Desktop) Remind(ctx context.Context, rs []Reminder) error
- func (d *Desktop) Withdraw(ctx context.Context, active map[string]bool) error
- type Mail
- type Note
- type Reminder
Constants ¶
const ( ActionSnooze = "snooze" ActionDismiss = "dismiss" )
Reminder actions, besides "default" (open the app).
Variables ¶
This section is empty.
Functions ¶
func Broadcast ¶
func Broadcast(publish func([]api.EventEnvelope)) func(ctx context.Context, accountID int64, mail []Mail) error
Broadcast announces new mail to the connected clients instead of the desktop, for a maild with no session bus (docs/specs/lodge-app.md, The web build): one transient message.announced event carrying the notes Notes makes, which each client shows itself. It returns an announcer for mailsync.Config.Announce.
Types ¶
type Desktop ¶
type Desktop struct {
// contains filtered or unexported fields
}
Desktop sends notifications over a session bus and runs open with the message of a clicked one (0 for a group note).
func NewDesktop ¶
func NewDesktop(ctx context.Context, conn *dbus.Conn, log *slog.Logger, open func(messageID int64)) (*Desktop, error)
NewDesktop sends over conn and watches it for clicks until ctx ends.
func OpenDesktop ¶
func OpenDesktop(ctx context.Context, log *slog.Logger, open func(messageID int64)) (*Desktop, error)
OpenDesktop connects to the session bus.
func (*Desktop) Announce ¶
Announce shows the notes of one account's new mail (Notes). A group note replaces the account's previous group note.
func (*Desktop) OnReminder ¶
OnReminder sets what clicking a reminder's notification or one of its actions does: action is "default", ActionSnooze or ActionDismiss.