diff options
Diffstat (limited to 'internal/notify/service.go')
| -rw-r--r-- | internal/notify/service.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/notify/service.go b/internal/notify/service.go index a2bf103..b29a783 100644 --- a/internal/notify/service.go +++ b/internal/notify/service.go @@ -39,10 +39,11 @@ type Service struct { mu sync.Mutex timers map[uint32]*time.Timer + cfg Config } func NewService(conn *dbus.Conn, dir string) *Service { - s := &Service{conn: conn, dir: dir, timers: map[uint32]*time.Timer{}} + s := &Service{conn: conn, dir: dir, timers: map[uint32]*time.Timer{}, cfg: DefaultConfig()} s.store = NewStore(s.emitClosed, func(live, history []Popup) { if err := Publish(s.dir, live, history); err != nil { log.Printf("notifyd: publish: %v", err) @@ -102,7 +103,10 @@ func (s *Service) Notify(appName string, replacesID uint32, appIcon, summary, bo u := UrgencyFromHints(hints) tag := StackTagFromHints(hints) now := time.Now().UnixMilli() - ms := EffectiveTimeoutMS(expireTimeout, u) + s.mu.Lock() + timeouts := s.cfg.Timeouts + s.mu.Unlock() + ms := EffectiveTimeoutMS(expireTimeout, u, timeouts) // Spec priority is image-data > image-path > the deprecated icon_data. A // raw blob cannot be written until Add has assigned the id the filename is // derived from, so any raw tier is held in pendingImage. |
