mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 05:06:51 +00:00
feat(BRIDGE-37): Remote notification support
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user