feat(BRIDGE-37): Remote notification support

This commit is contained in:
Atanas Janeshliev
2024-08-29 13:31:37 +02:00
parent ed1b65731a
commit f04350c046
43 changed files with 2350 additions and 1168 deletions

View File

@ -248,6 +248,10 @@ func (l *Locations) getUpdatesPath() string {
return filepath.Join(l.userData, "updates")
}
func (l *Locations) getNotificationsCachePath() string {
return filepath.Join(l.userCache, "notifications")
}
func (l *Locations) getStatsPath() string {
return filepath.Join(l.userData, "stats")
}
@ -276,3 +280,13 @@ func (l *Locations) ClearUpdates() error {
func (l *Locations) CleanGoIMAPCache() error {
return files.Remove(l.getGoIMAPCachePath()).Do()
}
// ProvideNotificationsCachePath returns a location for notification deduplication data.
// It creates it if it doesn't already exist.
func (l *Locations) ProvideNotificationsCachePath() (string, error) {
if err := os.MkdirAll(l.getNotificationsCachePath(), 0o700); err != nil {
return "", err
}
return l.getNotificationsCachePath(), nil
}