mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
feat(GODT-2442): add gRPC interface to send feedback.
This commit is contained in:
@ -90,6 +90,9 @@ type User struct {
|
||||
|
||||
syncWorkers int
|
||||
showAllMail uint32
|
||||
|
||||
// doResyncFeedback must be non-blocking for first attempt (i.e. buffered)
|
||||
doResyncFeedback chan bool
|
||||
}
|
||||
|
||||
// New returns a new user.
|
||||
@ -148,6 +151,8 @@ func New(
|
||||
|
||||
syncWorkers: syncWorkers,
|
||||
showAllMail: b32(showAllMail),
|
||||
|
||||
doResyncFeedback: make(chan bool, 1),
|
||||
}
|
||||
|
||||
// Initialize the user's update channels for its current address mode.
|
||||
@ -299,6 +304,16 @@ func (user *User) SetAddressMode(_ context.Context, mode vault.AddressMode) erro
|
||||
}, user.eventLock, user.apiAddrsLock, user.updateChLock)
|
||||
}
|
||||
|
||||
// SendBadEventFeedback sends user feedback whether should do message re-sync.
|
||||
func (user *User) SendBadEventFeedback(doResync bool) {
|
||||
user.doResyncFeedback <- doResync
|
||||
}
|
||||
|
||||
// GetBadEventFeedback read the user feedback whether should do message re-sync.
|
||||
func (user *User) GetBadEventFeedback() bool {
|
||||
return <-user.doResyncFeedback
|
||||
}
|
||||
|
||||
// SetShowAllMail sets whether to show the All Mail mailbox.
|
||||
func (user *User) SetShowAllMail(show bool) {
|
||||
user.log.WithField("show", show).Info("Setting show all mail")
|
||||
|
||||
Reference in New Issue
Block a user