mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 13:16:53 +00:00
Turning off IMAP server while no connection
This commit is contained in:
@ -156,7 +156,14 @@ func New( // nolint[funlen]
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cm := pmapi.NewClientManager(pmapi.GetAPIConfig(configName, constants.Version))
|
||||
apiConfig := pmapi.GetAPIConfig(configName, constants.Version)
|
||||
apiConfig.NoConnectionHandler = func() {
|
||||
eventListener.Emit(events.InternetOffEvent, "")
|
||||
}
|
||||
apiConfig.ConnectionHandler = func() {
|
||||
eventListener.Emit(events.InternetOnEvent, "")
|
||||
}
|
||||
cm := pmapi.NewClientManager(apiConfig)
|
||||
cm.SetRoundTripper(pmapi.GetRoundTripper(cm, listener))
|
||||
cm.SetCookieJar(jar)
|
||||
sentryReporter.SetUserAgentProvider(cm)
|
||||
|
||||
Reference in New Issue
Block a user