diff options
| author | Caroline Larimore <caroline@larimo.re> | 2025-01-30 22:26:55 -0800 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2025-01-30 22:26:55 -0800 |
| commit | 8fcb05ee54e250ae23113549e09fc11410829272 (patch) | |
| tree | 273c26a838973fdb448134be8ef34b791722338a /srv/corvidServer.go | |
| parent | d9ddbfa1b7e697884f2be1ea9f11f8ecb5a2027d (diff) | |
Add dismissal commands
Diffstat (limited to 'srv/corvidServer.go')
| -rw-r--r-- | srv/corvidServer.go | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/srv/corvidServer.go b/srv/corvidServer.go index 4a0556d..8b08a6e 100644 --- a/srv/corvidServer.go +++ b/srv/corvidServer.go @@ -1,39 +1,24 @@ package srv import ( - "log" - "github.com/godbus/dbus/v5" ) type corvidServer server -func (s corvidServer) Test(param uint32) (e *dbus.Error) { - log.Printf("Test called %d", param) +func (s corvidServer) Dismiss(id uint32) (e *dbus.Error) { + // log.Print("Dismiss called") + server(s).close(id, CloseReasonDismissed) + server(s).output() return nil } -// func (s corvidServer) GetCapabilities() (e *dbus.Error) { -// log.Print("GetCapabilities called") -// return nil -// } - -// func (s corvidServer) GetServerInformation() (name, vendor, version, specVersion string, e *dbus.Error) { -// // log.Print("GetServerInformation called") -// return "corvid", "CartConnoisseur", "0.1.0", "1.2", nil -// } - -// func (s corvidServer) CloseNotification(id uint32) (e *dbus.Error) { -// // log.Printf("CloseNotification called: %d", id) -// notification, ok := notifications.notifications[id] -// if ok { -// notification.close(CloseReasonClosed) -// } - -// return nil -// } +func (s corvidServer) DismissAll() (e *dbus.Error) { + // log.Print("DismissAll called") + for _, notification := range s.notifications.notifications { + server(s).close(notification.Id, CloseReasonDismissed) + } -// func (s corvidServer) Notify(appName string, replacesId uint32, appIcon string, summary string, body string, actions []string, hints map[string]dbus.Variant, expireTimeout int32) (id uint32, e *dbus.Error) { -// // log.Print("Notify called") - -// } + server(s).output() + return nil +} |