mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
feat(BRIDGE-75): Bridge repair button/feature implemented
This commit is contained in:
@ -717,3 +717,22 @@ func (user *User) protonAddresses() []proton.Address {
|
||||
|
||||
return addresses
|
||||
}
|
||||
|
||||
func (user *User) VerifyResyncAndExecute() {
|
||||
user.log.Info("Checking whether logged in user should re-sync. UserID:", user.ID())
|
||||
if user.vault.GetShouldResync() {
|
||||
user.log.Info("User should re-sync, starting re-sync process. UserID:", user.ID())
|
||||
|
||||
if err := user.vault.SetShouldSync(false); err != nil {
|
||||
user.log.WithError(err).Error("Failed to disable re-sync flag in user vault. UserID:", user.ID())
|
||||
}
|
||||
|
||||
if err := user.ResyncIMAP(); err != nil {
|
||||
user.log.WithError(err).Error("Failed re-syncing IMAP for userID", user.ID())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (user *User) ResyncIMAP() error {
|
||||
return user.imapService.Resync(context.Background())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user