MCPcopy
hub / github.com/safing/portmaster / notify

Method notify

service/compat/notify.go:114–141  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

112}
113
114func (issue *systemIssue) notify(err error) { //nolint // TODO: Should we use the error?
115 systemIssueNotificationLock.Lock()
116 defer systemIssueNotificationLock.Unlock()
117
118 if systemIssueNotification != nil {
119 // Ignore duplicate notification.
120 if issue.id == systemIssueNotification.EventID {
121 return
122 }
123
124 // Remove old notification.
125 systemIssueNotification.Delete()
126 }
127
128 // Create new notification.
129 n := &notifications.Notification{
130 EventID: issue.id,
131 Type: issue.level,
132 Title: issue.title,
133 Message: issue.message,
134 ShowOnSystem: true,
135 AvailableActions: issue.actions,
136 }
137 notifications.Notify(n)
138
139 systemIssueNotification = n
140 n.SyncWithState(module.states)
141}
142
143func resetSystemIssue() {
144 systemIssueNotificationLock.Lock()

Callers

nothing calls this directly

Calls 5

SyncWithStateMethod · 0.95
NotifyFunction · 0.92
LockMethod · 0.65
UnlockMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected