feat: set default sync period to 30 days for new accounts

This commit is contained in:
Richard Ramos 2022-04-01 10:59:45 -04:00
parent b47b3e8be6
commit c3aa69b8ab
2 changed files with 10 additions and 0 deletions

View File

@ -81,6 +81,10 @@ proc delete*(self: Controller) =
discard
proc init*(self: Controller) =
if self.accountsService.isFirstTimeAccountLogin():
let d9 = 9*86400 # 9 days
discard self.settingsService.setDefaultSyncPeriod(d9)
self.events.on("mailserverAvailable") do(e:Args):
echo "MAILSERVER AVAILABLE: ", repr(e)
# We need to take some actions here. This is the only pace where "mailserverAvailable" signal should be handled.

View File

@ -435,6 +435,12 @@ QtObject:
proc autoMessageEnabled*(self: Service): bool =
return self.settings.autoMessageEnabled
proc setDefaultSyncPeriod*(self: Service, value: int): bool =
if(self.saveSetting(KEY_DEFAULT_SYNC_PERIOD,value)):
self.settings.defaultSyncPeriod = value
return true
return false
proc getWakuBloomFilterMode*(self: Service): bool =
return self.settings.wakuBloomFilterMode