1
0

GODT-1846: remove restart cues, implement restart-less behaviour.

Other: fixed case issue in SSL member function names.
Other: removed 'restart' mention in SMTP and IMAP SSL settings.
GODT-1846: modified gRPC server to introduce ConnectionMode settings.
GODT-1846: implemented connection mode handling in bridge-gui.
GODT-1846: implemented error reporting in bridge-gui for connection mode.
Other: gathered all IMAP/SMTP server settings.
GODT-1846: wired IMAP/SMTP port change errors.
Other: Renamed some error events and signals.
Other: Fixed crash in IMAP restart when not started.
Other: dismiss port error notifications before changing ports.
Other: misc. fixes.
This commit is contained in:
Xavier Michelon
2022-11-20 09:58:20 +01:00
committed by James Houlahan
parent 46c0463e43
commit 1f0312573a
25 changed files with 3249 additions and 4244 deletions

View File

@ -68,8 +68,10 @@ func (bridge *Bridge) serveIMAP() error {
func (bridge *Bridge) restartIMAP() error { func (bridge *Bridge) restartIMAP() error {
logrus.Info("Restarting IMAP server") logrus.Info("Restarting IMAP server")
if err := bridge.imapListener.Close(); err != nil { if bridge.imapListener != nil {
return fmt.Errorf("failed to close IMAP listener: %w", err) if err := bridge.imapListener.Close(); err != nil {
return fmt.Errorf("failed to close IMAP listener: %w", err)
}
} }
return bridge.serveIMAP() return bridge.serveIMAP()

View File

@ -71,7 +71,13 @@ void QMLBackend::init(GRPCConfig const &serviceConfig)
app().grpc().goos(goos_); app().grpc().goos(goos_);
app().grpc().logsPath(logsPath_); app().grpc().logsPath(logsPath_);
app().grpc().licensePath(licensePath_); app().grpc().licensePath(licensePath_);
bool sslForIMAP = false, sslForSMTP = false;
int imapPort = 0, smtpPort = 0;
app().grpc().mailServerSettings(imapPort, smtpPort, sslForIMAP, sslForSMTP);
this->setIMAPPort(imapPort);
this->setSMTPPort(smtpPort);
this->setUseSSLForIMAP(sslForIMAP);
this->setUseSSLForSMTP(sslForSMTP);
this->retrieveUserList(); this->retrieveUserList();
} }
@ -140,10 +146,14 @@ void QMLBackend::connectGrpcEvents()
connect(client, &GRPCClient::updateVersionChanged, this, &QMLBackend::onVersionChanged); connect(client, &GRPCClient::updateVersionChanged, this, &QMLBackend::onVersionChanged);
// mail settings events // mail settings events
connect(client, &GRPCClient::portIssueIMAP, this, &QMLBackend::portIssueIMAP); connect(client, &GRPCClient::imapPortStartupError, this, &QMLBackend::imapPortStartupError);
connect(client, &GRPCClient::portIssueSMTP, this, &QMLBackend::portIssueSMTP); connect(client, &GRPCClient::smtpPortStartupError, this, &QMLBackend::smtpPortStartupError);
connect(client, &GRPCClient::toggleUseSSLFinished, this, &QMLBackend::toggleUseSSLFinished); connect(client, &GRPCClient::imapPortChangeError, this, &QMLBackend::imapPortChangeError);
connect(client, &GRPCClient::changePortFinished, this, &QMLBackend::changePortFinished); connect(client, &GRPCClient::smtpPortChangeError, this, &QMLBackend::smtpPortChangeError);
connect(client, &GRPCClient::imapConnectionModeChangeError, this, &QMLBackend::imapConnectionModeChangeError);
connect(client, &GRPCClient::smtpConnectionModeChangeError, this, &QMLBackend::smtpConnectionModeChangeError);
connect(client, &GRPCClient::mailServerSettingsChanged, this, &QMLBackend::onMailServerSettingsChanged);
connect(client, &GRPCClient::changeMailServerSettingsFinished, this, &QMLBackend::changeMailServerSettingsFinished);
// keychain events // keychain events
connect(client, &GRPCClient::changeKeychainFinished, this, &QMLBackend::changeKeychainFinished); connect(client, &GRPCClient::changeKeychainFinished, this, &QMLBackend::changeKeychainFinished);
@ -320,36 +330,113 @@ void QMLBackend::setDiskCachePath(QUrl const &path) const
app().grpc().setDiskCachePath(path); app().grpc().setDiskCachePath(path);
} }
//****************************************************************************************************************************************************
/// \param[in] makeItActive Should SSL for SMTP be enabled.
//****************************************************************************************************************************************************
void QMLBackend::toggleUseSSLforSMTP(bool makeItActive)
{
// if call succeed, app will restart. No need to emit a value change signal, because it will trigger a read-back via gRPC that will fail.
emit hideMainWindow();
app().grpc().setUseSSLForSMTP(makeItActive);
}
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \param[in] makeItActive Should SSL for IMAP be enabled. /// \return The IMAP port.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
void QMLBackend::toggleUseSSLforIMAP(bool makeItActive) int QMLBackend::imapPort() const
{ {
// if call succeed, app will restart. No need to emit a value change signal, because it will trigger a read-back via gRPC that will fail. return imapPort_;
emit hideMainWindow(); }
app().grpc().setUseSSLForIMAP(makeItActive);
//****************************************************************************************************************************************************
/// \param[in] port The IMAP port.
//****************************************************************************************************************************************************
void QMLBackend::setIMAPPort(int port)
{
if (port == imapPort_)
return;
imapPort_ = port;
emit imapPortChanged(port);
}
//****************************************************************************************************************************************************
/// \return The SMTP port.
//****************************************************************************************************************************************************
int QMLBackend::smtpPort() const
{
return smtpPort_;
}
//****************************************************************************************************************************************************
/// \param[in] port The SMTP port.
//****************************************************************************************************************************************************
void QMLBackend::setSMTPPort(int port)
{
if (port == smtpPort_)
return;
smtpPort_ = port;
emit smtpPortChanged(port);
}
//****************************************************************************************************************************************************
/// \return The value for the 'Use SSL for IMAP' property.
//****************************************************************************************************************************************************
bool QMLBackend::useSSLForIMAP() const
{
return useSSLForIMAP_;
}
//****************************************************************************************************************************************************
/// \param[in] value The value for the 'Use SSL for IMAP' property.
//****************************************************************************************************************************************************
void QMLBackend::setUseSSLForIMAP(bool value)
{
if (value == useSSLForIMAP_)
return;
useSSLForIMAP_ = value;
emit useSSLForIMAPChanged(value);
}
//****************************************************************************************************************************************************
/// \return The value for the 'Use SSL for SMTP' property.
//****************************************************************************************************************************************************
bool QMLBackend::useSSLForSMTP() const
{
return useSSLForSMTP_;
}
//****************************************************************************************************************************************************
/// \param[in] value The value for the 'Use SSL for SMTP' property.
//****************************************************************************************************************************************************
void QMLBackend::setUseSSLForSMTP(bool value)
{
if (value == useSSLForSMTP_)
return;
useSSLForSMTP_ = value;
emit useSSLForSMTPChanged(value);
} }
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \param[in] imapPort The IMAP port. /// \param[in] imapPort The IMAP port.
/// \param[in] smtpPort The SMTP port. /// \param[in] smtpPort The SMTP port.
/// \param[in] useSSLForIMAP The value for the 'Use SSL for IMAP' property
/// \param[in] useSSLForSMTP The value for the 'Use SSL for SMTP' property
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
void QMLBackend::changePorts(int imapPort, int smtpPort) void QMLBackend::setMailServerSettings(int imapPort, int smtpPort, bool useSSLForIMAP, bool useSSLForSMTP)
{ {
// if call succeed, app will restart. No need to emit a value change signal, because it will trigger a read-back via gRPC that will fail. app().grpc().setMailServerSettings(imapPort, smtpPort, useSSLForIMAP, useSSLForSMTP);
emit hideMainWindow(); }
app().grpc().changePorts(imapPort, smtpPort);
//****************************************************************************************************************************************************
/// \param[in] useSSLForIMAP The value for the 'Use SSL for IMAP' property
/// \param[in] useSSLForSMTP The value for the 'Use SSL for SMTP' property
//****************************************************************************************************************************************************
void QMLBackend::onMailServerSettingsChanged(int imapPort, int smtpPort, bool useSSLForIMAP, bool useSSLForSMTP)
{
this->setIMAPPort(imapPort);
this->setSMTPPort(smtpPort);
this->setUseSSLForIMAP(useSSLForIMAP);
this->setUseSSLForSMTP(useSSLForSMTP);
} }

View File

@ -69,10 +69,10 @@ public: // Qt/QML properties. Note that the NOTIFY-er signal is required even fo
Q_PROPERTY(bool isAllMailVisible READ isAllMailVisible NOTIFY isAllMailVisibleChanged) // _ bool `property:"isAllMailVisible"` Q_PROPERTY(bool isAllMailVisible READ isAllMailVisible NOTIFY isAllMailVisibleChanged) // _ bool `property:"isAllMailVisible"`
Q_PROPERTY(QString colorSchemeName READ colorSchemeName NOTIFY colorSchemeNameChanged) // _ string `property:"colorSchemeName"` Q_PROPERTY(QString colorSchemeName READ colorSchemeName NOTIFY colorSchemeNameChanged) // _ string `property:"colorSchemeName"`
Q_PROPERTY(QUrl diskCachePath READ diskCachePath NOTIFY diskCachePathChanged) // _ core.QUrl `property:"diskCachePath"` Q_PROPERTY(QUrl diskCachePath READ diskCachePath NOTIFY diskCachePathChanged) // _ core.QUrl `property:"diskCachePath"`
Q_PROPERTY(bool useSSLforSMTP READ useSSLForSMTP NOTIFY useSSLforSMTPChanged) // _ bool `property:"useSSLforSMTP"` Q_PROPERTY(bool useSSLForIMAP READ useSSLForIMAP WRITE setUseSSLForIMAP NOTIFY useSSLForIMAPChanged) // _ bool `property:"useSSLForSMTP"`
Q_PROPERTY(bool useSSLforIMAP READ useSSLForIMAP NOTIFY useSSLforIMAPChanged) // _ bool `property:"useSSLforIMAP"` Q_PROPERTY(bool useSSLForSMTP READ useSSLForSMTP WRITE setUseSSLForSMTP NOTIFY useSSLForSMTPChanged) // _ bool `property:"useSSLForSMTP"`
Q_PROPERTY(int portIMAP READ portIMAP NOTIFY portIMAPChanged) // _ int `property:"portIMAP"` Q_PROPERTY(int imapPort READ imapPort WRITE setIMAPPort NOTIFY imapPortChanged)
Q_PROPERTY(int portSMTP READ portSMTP NOTIFY portSMTPChanged) // _ int `property:"portSMTP"` Q_PROPERTY(int smtpPort READ smtpPort WRITE setSMTPPort NOTIFY smtpPortChanged)
Q_PROPERTY(bool isDoHEnabled READ isDoHEnabled NOTIFY isDoHEnabledChanged) // _ bool `property:"isDoHEnabled"` Q_PROPERTY(bool isDoHEnabled READ isDoHEnabled NOTIFY isDoHEnabledChanged) // _ bool `property:"isDoHEnabled"`
Q_PROPERTY(bool isFirstGUIStart READ isFirstGUIStart) // _ bool `property:"isFirstGUIStart"` Q_PROPERTY(bool isFirstGUIStart READ isFirstGUIStart) // _ bool `property:"isFirstGUIStart"`
Q_PROPERTY(bool isAutomaticUpdateOn READ isAutomaticUpdateOn NOTIFY isAutomaticUpdateOnChanged) // _ bool `property:"isAutomaticUpdateOn"` Q_PROPERTY(bool isAutomaticUpdateOn READ isAutomaticUpdateOn NOTIFY isAutomaticUpdateOnChanged) // _ bool `property:"isAutomaticUpdateOn"`
@ -101,10 +101,14 @@ public: // Qt/QML properties. Note that the NOTIFY-er signal is required even fo
bool isAllMailVisible() const { bool v; app().grpc().isAllMailVisible(v); return v; } bool isAllMailVisible() const { bool v; app().grpc().isAllMailVisible(v); return v; }
QString colorSchemeName() const { QString name; app().grpc().colorSchemeName(name); return name; } QString colorSchemeName() const { QString name; app().grpc().colorSchemeName(name); return name; }
QUrl diskCachePath() const { QUrl path; app().grpc().diskCachePath(path); return path; } QUrl diskCachePath() const { QUrl path; app().grpc().diskCachePath(path); return path; }
bool useSSLForSMTP() const{ bool useSSL; app().grpc().useSSLForSMTP(useSSL); return useSSL; } bool useSSLForIMAP() const;
bool useSSLForIMAP() const{ bool useSSL; app().grpc().useSSLForIMAP(useSSL); return useSSL; } void setUseSSLForIMAP(bool value);
int portIMAP() const { int port; app().grpc().portIMAP(port); return port; } bool useSSLForSMTP() const;
int portSMTP() const { int port; app().grpc().portSMTP(port); return port; } void setUseSSLForSMTP(bool value);
int imapPort() const;
void setIMAPPort(int port);
int smtpPort() const;
void setSMTPPort(int port);
bool isDoHEnabled() const { bool isEnabled; app().grpc().isDoHEnabled(isEnabled); return isEnabled;} bool isDoHEnabled() const { bool isEnabled; app().grpc().isDoHEnabled(isEnabled); return isEnabled;}
bool isFirstGUIStart() const { bool v; app().grpc().isFirstGUIStart(v); return v; }; bool isFirstGUIStart() const { bool v; app().grpc().isFirstGUIStart(v); return v; };
bool isAutomaticUpdateOn() const { bool isOn = false; app().grpc().isAutomaticUpdateOn(isOn); return isOn; } bool isAutomaticUpdateOn() const { bool isOn = false; app().grpc().isAutomaticUpdateOn(isOn); return isOn; }
@ -119,8 +123,10 @@ signals: // Signal used by the Qt property system. Many of them are unused but r
void showOnStartupChanged(bool value); void showOnStartupChanged(bool value);
void goosChanged(QString const &value); void goosChanged(QString const &value);
void diskCachePathChanged(QUrl const &url); void diskCachePathChanged(QUrl const &url);
void useSSLforSMTPChanged(bool value); void imapPortChanged(int port);
void useSSLforIMAPChanged(bool value); void smtpPortChanged(int port);
void useSSLForSMTPChanged(bool value);
void useSSLForIMAPChanged(bool value);
void isAutomaticUpdateOnChanged(bool value); void isAutomaticUpdateOnChanged(bool value);
void isBetaEnabledChanged(bool value); void isBetaEnabledChanged(bool value);
void isAllMailVisibleChanged(bool value); void isAllMailVisibleChanged(bool value);
@ -139,8 +145,6 @@ signals: // Signal used by the Qt property system. Many of them are unused but r
void availableKeychainChanged(QStringList const &keychains); void availableKeychainChanged(QStringList const &keychains);
void hostnameChanged(QString const &hostname); void hostnameChanged(QString const &hostname);
void isAutostartOnChanged(bool value); void isAutostartOnChanged(bool value);
void portIMAPChanged(int port);
void portSMTPChanged(int port);
void usersChanged(UserList* users); void usersChanged(UserList* users);
void dockIconVisibleChanged(bool value); void dockIconVisibleChanged(bool value);
@ -154,9 +158,6 @@ public slots: // slot for signals received from QML -> To be forwarded to Bridge
void login2FA(QString const& username, QString const& code) { app().grpc().login2FA(username, code);} // _ func(username, code string) `slot:"login2FA"` void login2FA(QString const& username, QString const& code) { app().grpc().login2FA(username, code);} // _ func(username, code string) `slot:"login2FA"`
void login2Password(QString const& username, QString const& password) { app().grpc().login2Passwords(username, password);} // _ func(username, password string) `slot:"login2Password"` void login2Password(QString const& username, QString const& password) { app().grpc().login2Passwords(username, password);} // _ func(username, password string) `slot:"login2Password"`
void loginAbort(QString const& username){ app().grpc().loginAbort(username);} // _ func(username string) `slot:"loginAbort"` void loginAbort(QString const& username){ app().grpc().loginAbort(username);} // _ func(username string) `slot:"loginAbort"`
void toggleUseSSLforSMTP(bool makeItActive); // _ func(makeItActive bool) `slot:"toggleUseSSLforSMTP"`
void toggleUseSSLforIMAP(bool makeItActive); // _ func(makeItActive bool) `slot:"toggleUseSSLforIMAP"`
void changePorts(int imapPort, int smtpPort); // _ func(imapPort, smtpPort int) `slot:"changePorts"`
void toggleDoH(bool active); // _ func(makeItActive bool) `slot:"toggleDoH"` void toggleDoH(bool active); // _ func(makeItActive bool) `slot:"toggleDoH"`
void toggleAutomaticUpdate(bool makeItActive); // _ func(makeItActive bool) `slot:"toggleAutomaticUpdate"` void toggleAutomaticUpdate(bool makeItActive); // _ func(makeItActive bool) `slot:"toggleAutomaticUpdate"`
void updateCurrentMailClient() { emit currentEmailClientChanged(currentEmailClient()); } // _ func() `slot:"updateCurrentMailClient"` void updateCurrentMailClient() { emit currentEmailClientChanged(currentEmailClient()); } // _ func() `slot:"updateCurrentMailClient"`
@ -172,6 +173,10 @@ public slots: // slot for signals received from QML -> To be forwarded to Bridge
app().grpc().reportBug(description, address, emailClient, includeLogs); } // _ func(description, address, emailClient string, includeLogs bool) `slot:"reportBug"` app().grpc().reportBug(description, address, emailClient, includeLogs); } // _ func(description, address, emailClient string, includeLogs bool) `slot:"reportBug"`
void onResetFinished(); // _ func() `slot:"onResetFinished"` void onResetFinished(); // _ func() `slot:"onResetFinished"`
void onVersionChanged(); // _ func() `slot:"onVersionChanged"` void onVersionChanged(); // _ func() `slot:"onVersionChanged"`
void setMailServerSettings(int imapPort, int smtpPort, bool useSSLForIMAP, bool useSSLForSMTP); ///< Forwards to connection mode change request from QML to gRPC
public slots: // slot for signals received from gRPC that need transformation instead of simple forwarding
void onMailServerSettingsChanged(int imapPort, int smtpPort, bool useSSLForIMAP, bool useSSLForSMTP); ///< Slot for the ConnectionModeChanged gRPC event.
signals: // Signals received from the Go backend, to be forwarded to QML signals: // Signals received from the Go backend, to be forwarded to QML
void toggleAutostartFinished(); // _ func() `signal:"toggleAutostartFinished"` void toggleAutostartFinished(); // _ func() `signal:"toggleAutostartFinished"`
@ -199,10 +204,13 @@ signals: // Signals received from the Go backend, to be forwarded to QML
void updateSilentError(); // _ func() `signal:"updateSilentError"` void updateSilentError(); // _ func() `signal:"updateSilentError"`
void updateIsLatestVersion(); // _ func() `signal:"updateIsLatestVersion"` void updateIsLatestVersion(); // _ func() `signal:"updateIsLatestVersion"`
void checkUpdatesFinished(); // _ func() `signal:"checkUpdatesFinished"` void checkUpdatesFinished(); // _ func() `signal:"checkUpdatesFinished"`
void toggleUseSSLFinished(); // _ func() `signal:"toggleUseSSLFinished"` void imapPortStartupError();
void changePortFinished(); // _ func() `signal:"changePortFinished"` void smtpPortStartupError();
void portIssueIMAP(); // _ func() `signal:"portIssueIMAP"` void imapPortChangeError();
void portIssueSMTP(); // _ func() `signal:"portIssueSMTP"` void smtpPortChangeError();
void imapConnectionModeChangeError();
void smtpConnectionModeChangeError();
void changeMailServerSettingsFinished();
void changeKeychainFinished(); // _ func() `signal:"changeKeychainFinished"` void changeKeychainFinished(); // _ func() `signal:"changeKeychainFinished"`
void notifyHasNoKeychain(); // _ func() `signal:"notifyHasNoKeychain"` void notifyHasNoKeychain(); // _ func() `signal:"notifyHasNoKeychain"`
void notifyRebuildKeychain(); // _ func() `signal:"notifyRebuildKeychain"` void notifyRebuildKeychain(); // _ func() `signal:"notifyRebuildKeychain"`
@ -231,6 +239,10 @@ private: // data members
QString goos_; ///< The cached version of the GOOS variable. QString goos_; ///< The cached version of the GOOS variable.
QUrl logsPath_; ///< The logs path. Retrieved from bridge on startup. QUrl logsPath_; ///< The logs path. Retrieved from bridge on startup.
QUrl licensePath_; ///< The license path. Retrieved from bridge on startup. QUrl licensePath_; ///< The license path. Retrieved from bridge on startup.
int imapPort_ { 0 }; ///< The cached value for the IMAP port.
int smtpPort_ { 0 }; ///< The cached value for the SMTP port.
bool useSSLForIMAP_ { false }; ///< The cached value for useSSLForIMAP.
bool useSSLForSMTP_ { false }; ///< The cached value for useSSLForSMTP.
friend class AppController; friend class AppController;
}; };

View File

@ -229,20 +229,20 @@ Item {
colorScheme: root.colorScheme colorScheme: root.colorScheme
title: qsTr("IMAP") title: qsTr("IMAP")
hostname: Backend.hostname hostname: Backend.hostname
port: Backend.portIMAP.toString() port: Backend.imapPort.toString()
username: configuration.currentAddress username: configuration.currentAddress
password: root.user ? root.user.password : "" password: root.user ? root.user.password : ""
security : Backend.useSSLforIMAP ? "SSL" : "STARTTLS" security : Backend.useSSLForIMAP ? "SSL" : "STARTTLS"
} }
Configuration { Configuration {
colorScheme: root.colorScheme colorScheme: root.colorScheme
title: qsTr("SMTP") title: qsTr("SMTP")
hostname : Backend.hostname hostname : Backend.hostname
port : Backend.portSMTP.toString() port : Backend.smtpPort.toString()
username : configuration.currentAddress username : configuration.currentAddress
password : root.user ? root.user.password : "" password : root.user ? root.user.password : ""
security : Backend.useSSLforSMTP ? "SSL" : "STARTTLS" security : Backend.useSSLForSMTP ? "SSL" : "STARTTLS"
} }
} }
} }

View File

@ -696,7 +696,7 @@ Window {
} }
RowLayout { RowLayout {
Label {colorScheme: root.colorScheme; text: "SMTP using SSL:"} Label {colorScheme: root.colorScheme; text: "SMTP using SSL:"}
Toggle {colorScheme: root.colorScheme; checked: root.useSSLforSMTP; onClicked: root.useSSLforSMTP = !root.useSSLforSMTP} Toggle {colorScheme: root.colorScheme; checked: root.useSSLForSMTP; onClicked: root.useSSLForSMTP = !root.useSSLForSMTP}
} }
RowLayout { RowLayout {
Label {colorScheme: root.colorScheme; text: "Local cache:"} Label {colorScheme: root.colorScheme; text: "Local cache:"}
@ -822,9 +822,9 @@ Window {
} }
property bool useSSLforSMTP: false property bool useSSLForSMTP: false
function toggleUseSSLforSMTP(makeItActive){ function toggleUseSSLForSMTP(makeItActive){
console.debug("-> SMTP SSL", makeItActive, root.useSSLforSMTP) console.debug("-> SMTP SSL", makeItActive, root.useSSLForSMTP)
} }
signal toggleUseSSLFinished() signal toggleUseSSLFinished()
@ -841,8 +841,8 @@ Window {
return true return true
} }
signal changePortFinished() signal changePortFinished()
signal portIssueIMAP() signal imapPortStartupError()
signal portIssueSMTP() signal smtpPortStartupError()
function triggerReset() { function triggerReset() {
console.debug("-> trigger reset") console.debug("-> trigger reset")

View File

@ -315,7 +315,7 @@ Item {
PortSettings { // 4 PortSettings { // 4
colorScheme: root.colorScheme colorScheme: root.colorScheme
notifications: root.notifications
onBack: { onBack: {
rightContent.showGeneralSettings() rightContent.showGeneralSettings()
} }

View File

@ -36,7 +36,7 @@ SettingsView {
Label { Label {
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: qsTr("Changes require reconfiguration of email client. Bridge will automatically restart.") text: qsTr("Changes require reconfiguration of email client.")
type: Label.Body type: Label.Body
color: root.colorScheme.text_weak color: root.colorScheme.text_weak
Layout.fillWidth: true Layout.fillWidth: true
@ -80,13 +80,13 @@ SettingsView {
Button { Button {
id: submitButton id: submitButton
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: qsTr("Save and restart") text: qsTr("Save")
onClicked: { onClicked: {
submitButton.loading = true submitButton.loading = true
root.submit() root.submit()
} }
enabled: sslButton.checked !== Backend.useSSLforIMAP enabled: sslButton.checked !== Backend.useSSLForIMAP
} }
Button { Button {
@ -99,20 +99,21 @@ SettingsView {
Connections { Connections {
target: Backend target: Backend
function onToggleUseSSLFinished() { function onChangeMailServerSettingsFinished() {
submitButton.loading = false submitButton.loading = false
root.back()
} }
} }
} }
function submit(){ function submit(){
submitButton.loading = true submitButton.loading = true
Backend.toggleUseSSLforIMAP(sslButton.checked) Backend.setMailServerSettings(Backend.imapPort, Backend.smtpPort, sslButton.checked, Backend.useSSLForSMTP)
} }
function setDefaultValues(){ function setDefaultValues(){
sslButton.checked = Backend.useSSLforIMAP sslButton.checked = Backend.useSSLForIMAP
starttlsButton.checked = !Backend.useSSLforIMAP starttlsButton.checked = !Backend.useSSLForIMAP
} }
onVisibleChanged: { onVisibleChanged: {

View File

@ -46,8 +46,12 @@ QtObject {
property var all: [ property var all: [
root.noInternet, root.noInternet,
root.portIssueIMAP, root.imapPortStartupError,
root.portIssueSMTP, root.smtpPortStartupError,
root.imapPortChangeError,
root.smtpPortChangeError,
root.imapConnectionModeChangeError,
root.smtpConnectionModeChangeError,
root.updateManualReady, root.updateManualReady,
root.updateManualRestartNeeded, root.updateManualRestartNeeded,
root.updateManualError, root.updateManualError,
@ -98,8 +102,8 @@ QtObject {
} }
} }
property Notification portIssueIMAP: Notification { property Notification imapPortStartupError: Notification {
description: qsTr("The IMAP server could not be started. Please check or change the IMAP port and restart the application.") description: qsTr("The IMAP server could not be started. Please check or change the IMAP port.")
brief: qsTr("IMAP port error") brief: qsTr("IMAP port error")
icon: "./icons/ic-alert.svg" icon: "./icons/ic-alert.svg"
type: Notification.NotificationType.Danger type: Notification.NotificationType.Danger
@ -108,14 +112,14 @@ QtObject {
Connections { Connections {
target: Backend target: Backend
function onPortIssueIMAP() { function onImapPortStartupError() {
root.portIssueIMAP.active = true root.imapPortStartupError.active = true
} }
} }
} }
property Notification portIssueSMTP: Notification { property Notification smtpPortStartupError: Notification {
description: qsTr("The SMTP server could not be started. Please check or change the SMTP port and restart the application.") description: qsTr("The SMTP server could not be started. Please check or change the SMTP port.")
brief: qsTr("SMTP port error") brief: qsTr("SMTP port error")
icon: "./icons/ic-alert.svg" icon: "./icons/ic-alert.svg"
type: Notification.NotificationType.Danger type: Notification.NotificationType.Danger
@ -124,8 +128,88 @@ QtObject {
Connections { Connections {
target: Backend target: Backend
function onPortIssueSMTP() { function onSmtpPortStartupError() {
root.portIssueSMTP.active = true root.smtpPortStartupError.active = true
}
}
}
property Notification imapPortChangeError: Notification {
description: qsTr("The IMAP port could not be changed.")
brief: qsTr("IMAP port change error")
icon: "./icons/ic-alert.svg"
type: Notification.NotificationType.Danger
group: Notifications.Group.Connection
Connections {
target: Backend
function onImapPortChangeError() {
root.imapPortChangeError.active = true
}
}
}
property Notification smtpPortChangeError: Notification {
description: qsTr("The SMTP port could not be changed.")
brief: qsTr("SMTP port change error")
icon: "./icons/ic-alert.svg"
type: Notification.NotificationType.Danger
group: Notifications.Group.Connection
Connections {
target: Backend
function onSmtpPortChangeError() {
root.smtpPortChangeError.active = true
}
}
}
property Notification imapConnectionModeChangeError: Notification {
description: qsTr("The IMAP connection mode could not be changed.")
brief: qsTr("IMAP Connection mode change error")
icon: "./icons/ic-alert.svg"
type: Notification.NotificationType.Danger
group: Notifications.Group.Connection
Connections {
target: Backend
function onImapConnectionModeChangeError() {
root.imapConnectionModeChangeError.active = true
}
}
action: Action {
text: qsTr("OK")
onTriggered: {
root.imapConnectionModeChangeError.active= false
}
}
}
property Notification smtpConnectionModeChangeError: Notification {
description: qsTr("The SMTP connection mode could not be changed.")
brief: qsTr("SMTP Connection mode change error")
icon: "./icons/ic-alert.svg"
type: Notification.NotificationType.Danger
group: Notifications.Group.Connection
Connections {
target: Backend
function onSmtpConnectionModeChangeError() {
root.smtpConnectionModeChangeError.active = true
}
}
action: Action {
text: qsTr("OK")
onTriggered: {
root.smtpConnectionModeChangeError.active= false
} }
} }
} }

View File

@ -27,9 +27,11 @@ SettingsView {
fillHeight: false fillHeight: false
property var notifications
property bool _valuesChanged: ( property bool _valuesChanged: (
imapField.text*1 !== Backend.portIMAP || imapField.text*1 !== Backend.imapPort ||
smtpField.text*1 !== Backend.portSMTP smtpField.text*1 !== Backend.smtpPort
) )
Label { Label {
@ -41,7 +43,7 @@ SettingsView {
Label { Label {
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: qsTr("Changes require reconfiguration of your email client. Bridge will automatically restart.") text: qsTr("Changes require reconfiguration of your email client.")
type: Label.Body type: Label.Body
color: root.colorScheme.text_weak color: root.colorScheme.text_weak
Layout.fillWidth: true Layout.fillWidth: true
@ -81,7 +83,7 @@ SettingsView {
Button { Button {
id: submitButton id: submitButton
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: qsTr("Save and restart") text: qsTr("Save")
enabled: root._valuesChanged enabled: root._valuesChanged
onClicked: { onClicked: {
// removing error here because we may have set it manually (port occupied) // removing error here because we may have set it manually (port occupied)
@ -109,7 +111,13 @@ SettingsView {
return return
} }
Backend.changePorts(imapField.text, smtpField.text) // We turn off all port error notification. They well be restored if problems persist
root.notifications.imapPortStartupError.active = false
root.notifications.smtpPortStartupError.active = false
root.notifications.imapPortChangeError.active = false
root.notifications.smtpPortChangeError.active = false
Backend.setMailServerSettings(imapField.text, smtpField.text, Backend.useSSLForIMAP, Backend.useSSLForSMTP)
} }
} }
@ -123,7 +131,7 @@ SettingsView {
Connections { Connections {
target: Backend target: Backend
function onChangePortFinished() { function onChangeMailServerSettingsFinished() {
submitButton.loading = false submitButton.loading = false
} }
} }
@ -148,8 +156,8 @@ SettingsView {
function isPortFree(field) { function isPortFree(field) {
var num = field.text*1 var num = field.text*1
if (num === Backend.portIMAP) return true if (num === Backend.imapPort) return true
if (num === Backend.portSMTP) return true if (num === Backend.smtpPort) return true
if (!Backend.isPortFree(num)) { if (!Backend.isPortFree(num)) {
field.error = true field.error = true
field.errorString = qsTr("Port occupied") field.errorString = qsTr("Port occupied")
@ -160,8 +168,8 @@ SettingsView {
} }
function setDefaultValues(){ function setDefaultValues(){
imapField.text = Backend.portIMAP imapField.text = Backend.imapPort
smtpField.text = Backend.portSMTP smtpField.text = Backend.smtpPort
imapField.error = false imapField.error = false
smtpField.error = false smtpField.error = false
} }

View File

@ -36,7 +36,7 @@ SettingsView {
Label { Label {
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: qsTr("Changes require reconfiguration of email client. Bridge will automatically restart.") text: qsTr("Changes require reconfiguration of email client.")
type: Label.Body type: Label.Body
color: root.colorScheme.text_weak color: root.colorScheme.text_weak
Layout.fillWidth: true Layout.fillWidth: true
@ -80,13 +80,13 @@ SettingsView {
Button { Button {
id: submitButton id: submitButton
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: qsTr("Save and restart") text: qsTr("Save")
onClicked: { onClicked: {
submitButton.loading = true submitButton.loading = true
root.submit() root.submit()
} }
enabled: sslButton.checked !== Backend.useSSLforSMTP enabled: sslButton.checked !== Backend.useSSLForSMTP
} }
Button { Button {
@ -99,20 +99,21 @@ SettingsView {
Connections { Connections {
target: Backend target: Backend
function onToggleUseSSLFinished() { function onChangeMailServerSettingsFinished() {
submitButton.loading = false submitButton.loading = false
root.back()
} }
} }
} }
function submit(){ function submit() {
submitButton.loading = true submitButton.loading = true
Backend.toggleUseSSLforSMTP(sslButton.checked) Backend.setMailServerSettings(Backend.imapPort, Backend.smtpPort, Backend.useSSLForIMAP, sslButton.checked)
} }
function setDefaultValues(){ function setDefaultValues(){
sslButton.checked = Backend.useSSLforSMTP sslButton.checked = Backend.useSSLForSMTP
starttlsButton.checked = !Backend.useSSLforSMTP starttlsButton.checked = !Backend.useSSLForSMTP
} }
onVisibleChanged: { onVisibleChanged: {

View File

@ -88,10 +88,10 @@ bridgepp::SPStreamEvent wrapCacheEvent(grpc::DiskCacheEvent *cacheEvent)
/// \param[in] mailSettingsEvent The mail settings event. /// \param[in] mailSettingsEvent The mail settings event.
/// \return The stream event. /// \return The stream event.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
bridgepp::SPStreamEvent wrapMailSettingsEvent(grpc::MailSettingsEvent *mailSettingsEvent) bridgepp::SPStreamEvent wrapMailServerSettingsEvent(grpc::MailServerSettingsEvent *mailServerSettingsEvent)
{ {
auto event = newStreamEvent(); auto event = newStreamEvent();
event->set_allocated_mailsettings(mailSettingsEvent); event->set_allocated_mailserversettings(mailServerSettingsEvent);
return event; return event;
} }
@ -420,54 +420,45 @@ SPStreamEvent newDiskCachePathChangeFinishedEvent()
return wrapCacheEvent(cacheEvent); return wrapCacheEvent(cacheEvent);
} }
SPStreamEvent newChangeMailServerSettingsFinished(); ///< Create a new ChangeMailServerSettingsFinished event.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \param[in] errorType The error type. /// \param[in] errorType The error type.
/// \return The event. /// \return The event.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
SPStreamEvent newMailSettingsErrorEvent(grpc::MailSettingsErrorType errorType) SPStreamEvent newMailServerSettingsErrorEvent(grpc::MailServerSettingsErrorType errorType)
{ {
auto event = new grpc::MailSettingsErrorEvent; auto event = new grpc::MailServerSettingsErrorEvent;
event->set_type(errorType); event->set_type(errorType);
auto mailSettingsEvent = new grpc::MailSettingsEvent; auto mailServerSettingsEvent = new grpc::MailServerSettingsEvent;
mailSettingsEvent->set_allocated_error(event); mailServerSettingsEvent->set_allocated_error(event);
return wrapMailSettingsEvent(mailSettingsEvent); return wrapMailServerSettingsEvent(mailServerSettingsEvent);
}
//****************************************************************************************************************************************************
/// \param[in] settings The settings.
/// \return The event.
//****************************************************************************************************************************************************
SPStreamEvent newMailServerSettingsChanged(grpc::ImapSmtpSettings *settings)
{
auto event = new grpc::MailServerSettingsChangedEvent;
event->set_allocated_settings(settings);
auto mailServerSettingsEvent = new grpc::MailServerSettingsEvent;
mailServerSettingsEvent->set_allocated_mailserversettingschanged(event);
return wrapMailServerSettingsEvent(mailServerSettingsEvent);
} }
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \return The event. /// \return The event.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
SPStreamEvent newUseSslForImapFinishedEvent() SPStreamEvent newChangeMailServerSettingsFinished()
{ {
auto event = new grpc::UseSslForImapFinishedEvent; auto event = new grpc::ChangeMailServerSettingsFinishedEvent;
auto mailSettingsEvent = new grpc::MailSettingsEvent; auto mailServerSettingsEvent = new grpc::MailServerSettingsEvent;
mailSettingsEvent->set_allocated_usesslforimapfinished(event); mailServerSettingsEvent->set_allocated_changemailserversettingsfinished(event);
return wrapMailSettingsEvent(mailSettingsEvent); return wrapMailServerSettingsEvent(mailServerSettingsEvent);
}
//****************************************************************************************************************************************************
/// \return The event.
//****************************************************************************************************************************************************
SPStreamEvent newUseSslForSmtpFinishedEvent()
{
auto event = new grpc::UseSslForSmtpFinishedEvent;
auto mailSettingsEvent = new grpc::MailSettingsEvent;
mailSettingsEvent->set_allocated_usesslforsmtpfinished(event);
return wrapMailSettingsEvent(mailSettingsEvent);
}
//****************************************************************************************************************************************************
/// \return The event.
//****************************************************************************************************************************************************
SPStreamEvent newChangePortsFinishedEvent()
{
auto event = new grpc::ChangePortsFinishedEvent;
auto mailSettingsEvent = new grpc::MailSettingsEvent;
mailSettingsEvent->set_allocated_changeportsfinished(event);
return wrapMailSettingsEvent(mailSettingsEvent);
} }

View File

@ -59,10 +59,9 @@ SPStreamEvent newDiskCachePathChangedEvent(QString const &path); ///< Create a n
SPStreamEvent newDiskCachePathChangeFinishedEvent(); ///< Create a new DiskCachePathChangeFinishedEvent event. SPStreamEvent newDiskCachePathChangeFinishedEvent(); ///< Create a new DiskCachePathChangeFinishedEvent event.
// Mail settings related events // Mail settings related events
SPStreamEvent newMailSettingsErrorEvent(grpc::MailSettingsErrorType errorType); ///< Create a new MailSettingsErrorEvent event. SPStreamEvent newMailServerSettingsErrorEvent(grpc::MailServerSettingsErrorType errorType); ///< Create a new MailSettingsErrorEvent event.
SPStreamEvent newUseSslForImapFinishedEvent(); ///< Create a new UseSslForImapFinishedEvent event. SPStreamEvent newMailServerSettingsChanged(grpc::ImapSmtpSettings settings); ///< Create a new ConnectionModeChanged event.
SPStreamEvent newUseSslForSmtpFinishedEvent(); ///< Create a new UseSslForSmtpFinishedEvent event. SPStreamEvent newChangeMailServerSettingsFinished(); ///< Create a new ChangeMailServerSettingsFinished event.
SPStreamEvent newChangePortsFinishedEvent(); ///< Create a new ChangePortsFinishedEvent event.
// keychain related events // keychain related events
SPStreamEvent newChangeKeychainFinishedEvent(); ///< Create a new ChangeKeychainFinishedEvent event. SPStreamEvent newChangeKeychainFinishedEvent(); ///< Create a new ChangeKeychainFinishedEvent event.

View File

@ -338,56 +338,39 @@ grpc::Status GRPCClient::reportBug(QString const &description, QString const &ad
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \param[out] outUseSSL The value for the property. /// \param[out] outIMAPPort The IMAP port.
/// \param[out] outSMTPPort The SMTP port.
/// \param[out] outUseSSLForIMAP The IMAP connection mode.
/// \param[out] outUseSSLForSMTP The SMTP connection mode.
/// \return The status for the gRPC call. /// \return The status for the gRPC call.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
grpc::Status GRPCClient::useSSLForSMTP(bool &outUseSSL) grpc::Status GRPCClient::mailServerSettings(qint32 &outIMAPPort, qint32 &outSMTPPort, bool &outUseSSLForIMAP, bool &outUseSSLForSMTP)
{ {
return this->logGRPCCallStatus(this->getBool(&Bridge::Stub::UseSslForSmtp, outUseSSL), __FUNCTION__); ImapSmtpSettings settings;
Status status = this->logGRPCCallStatus(stub_->MailServerSettings(this->clientContext().get(), empty, &settings), __FUNCTION__);
if (status.ok()) {
outIMAPPort = settings.imapport();
outSMTPPort = settings.smtpport();
outUseSSLForIMAP = settings.usesslforimap();
outUseSSLForSMTP = settings.usesslforsmtp();
}
return status;
} }
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \param[in] useSSL The new value for the property. /// \param[in] useSSLForIMAP The IMAP connection mode.
/// \param[in] useSSLForSMTP The SMTP connection mode.
/// \return The status for the gRPC call. /// \return The status for the gRPC call.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
grpc::Status GRPCClient::setUseSSLForSMTP(bool useSSL) grpc::Status GRPCClient::setMailServerSettings(qint32 imapPort, qint32 smtpPort, bool useSSLForIMAP, bool useSSLForSMTP)
{ {
return this->logGRPCCallStatus(this->setBool(&Bridge::Stub::SetUseSslForSmtp, useSSL), __FUNCTION__); ImapSmtpSettings settings;
} settings.set_imapport(imapPort);
settings.set_smtpport(smtpPort);
settings.set_usesslforimap(useSSLForIMAP);
//**************************************************************************************************************************************************** settings.set_usesslforsmtp(useSSLForSMTP);
/// \param[out] outPort The port. return this->logGRPCCallStatus(stub_->SetMailServerSettings(this->clientContext().get(), settings, &empty), __FUNCTION__);
/// \return The status for the gRPC call.
//****************************************************************************************************************************************************
grpc::Status GRPCClient::portIMAP(int &outPort)
{
return this->logGRPCCallStatus(this->getInt32(&Bridge::Stub::ImapPort, outPort), __FUNCTION__);
}
//****************************************************************************************************************************************************
/// \param[out] outPort The port.
/// \return The status for the gRPC call.
//****************************************************************************************************************************************************
grpc::Status GRPCClient::portSMTP(int &outPort)
{
return this->logGRPCCallStatus(this->getInt32(&Bridge::Stub::SmtpPort, outPort), __FUNCTION__);
}
//****************************************************************************************************************************************************
/// \param[in] portIMAP The IMAP port.
/// \param[in] portSMTP The SMTP port.
/// \return The status for the gRPC call.
//****************************************************************************************************************************************************
grpc::Status GRPCClient::changePorts(int portIMAP, int portSMTP)
{
ChangePortsRequest request;
request.set_imapport(portIMAP);
request.set_smtpport(portSMTP);
return this->logGRPCCallStatus(stub_->ChangePorts(this->clientContext().get(), request, &empty), __FUNCTION__);
} }
@ -411,26 +394,6 @@ grpc::Status GRPCClient::setIsDoHEnabled(bool enabled)
} }
//****************************************************************************************************************************************************
/// \param[out] outUseSSL The value for the property.
/// \return The status for the gRPC call.
//****************************************************************************************************************************************************
grpc::Status GRPCClient::useSSLForIMAP(bool &outUseSSL)
{
return this->logGRPCCallStatus(this->getBool(&Bridge::Stub::UseSslForImap, outUseSSL), __FUNCTION__);
}
//****************************************************************************************************************************************************
/// \param[in] useSSL The new value for the property.
/// \return The status for the gRPC call.
//****************************************************************************************************************************************************
grpc::Status GRPCClient::setUseSSLForIMAP(bool useSSL)
{
return this->logGRPCCallStatus(this->setBool(&Bridge::Stub::SetUseSslForImap, useSSL), __FUNCTION__);
}
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \return The status for the gRPC call. /// \return The status for the gRPC call.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
@ -875,8 +838,8 @@ grpc::Status GRPCClient::runEventStreamReader()
case grpc::StreamEvent::kCache: case grpc::StreamEvent::kCache:
this->processCacheEvent(event.cache()); this->processCacheEvent(event.cache());
break; break;
case grpc::StreamEvent::kMailSettings: case grpc::StreamEvent::kMailServerSettings:
this->processMailSettingsEvent(event.mailsettings()); this->processMailServerSettingsEvent(event.mailserversettings());
break; break;
case grpc::StreamEvent::kKeychain: case grpc::StreamEvent::kKeychain:
this->processKeychainEvent(event.keychain()); this->processKeychainEvent(event.keychain());
@ -1347,39 +1310,50 @@ void GRPCClient::processCacheEvent(DiskCacheEvent const &event)
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
/// \param[in] event The event. /// \param[in] event The event.
//**************************************************************************************************************************************************** //****************************************************************************************************************************************************
void GRPCClient::processMailSettingsEvent(MailSettingsEvent const &event) void GRPCClient::processMailServerSettingsEvent(MailServerSettingsEvent const &event)
{ {
switch (event.event_case()) switch (event.event_case())
{ {
case MailSettingsEvent::kError: case MailServerSettingsEvent::kError:
this->logTrace("MailSettings event received: Error."); this->logTrace(QString("MailServerSettings event received: Error %1").arg(qint32(event.error().type())));
switch (event.error().type()) switch (event.error().type())
{ {
case IMAP_PORT_ISSUE: case grpc::IMAP_PORT_STARTUP_ERROR:
emit portIssueIMAP(); emit imapPortStartupError();
break; return;
case SMTP_PORT_ISSUE: case grpc::SMTP_PORT_STARTUP_ERROR:
emit portIssueSMTP(); emit smtpPortStartupError();
break; return;
case IMAP_PORT_CHANGE_ERROR:
emit imapPortChangeError();
return;
case SMTP_PORT_CHANGE_ERROR:
emit smtpPortChangeError();
return;
case IMAP_CONNECTION_MODE_CHANGE_ERROR:
emit imapConnectionModeChangeError();
return;
case SMTP_CONNECTION_MODE_CHANGE_ERROR:
emit smtpConnectionModeChangeError();
return;
default: default:
this->logError("Unknown mail settings error event received."); this->logError("Unknown mail settings error event received.");
break; return;
} }
case MailServerSettingsEvent::kMailServerSettingsChanged:
case MailSettingsEvent::kUseSslForSmtpFinished: {
this->logTrace("MailSettings event received: UseSslForSmtpFinished."); this->logTrace("MailServerSettings event received: MailServerSettingsChanged.");
emit toggleUseSSLFinished(); ImapSmtpSettings const settings = event.mailserversettingschanged().settings();
break; emit mailServerSettingsChanged(settings.imapport(), settings.smtpport(), settings.usesslforimap(), settings.usesslforsmtp());
case MailSettingsEvent::kUseSslForImapFinished: return;
this->logTrace("MailSettings event received: UseSslForImapFinished."); }
emit toggleUseSSLFinished(); case MailServerSettingsEvent::kChangeMailServerSettingsFinished:
break; this->logTrace("MailServerSettings event received: ChangeMailServerSettingsFinished.");
case MailSettingsEvent::kChangePortsFinished: emit changeMailServerSettingsFinished();
this->logTrace("MailSettings event received: ChangePortsFinished."); return;
emit changePortFinished();
break;
default: default:
this->logError("Unknown MailSettings event received."); this->logError("Unknown MailServerSettings event received.");
return;
} }
} }

View File

@ -116,21 +116,20 @@ signals:
// mail settings related calls // mail settings related calls
public: public:
grpc::Status useSSLForSMTP(bool &outUseSSL); ///< Performs the 'useSSLForSMTP' gRPC call grpc::Status mailServerSettings(qint32 &outIMAPPort, qint32 &outSMTPPort, bool &outUseSSLForIMAP, bool &outUseSSLForSMTP); ///< Performs the 'MailServerSettings' gRPC call.
grpc::Status setUseSSLForSMTP(bool useSSL); ///< Performs the 'currentEmailClient' gRPC call. grpc::Status setMailServerSettings(qint32 imapPort, qint32 smtpPort, bool useSSLForIMAP, bool useSSLForSMTP); ///< Performs the 'SetMailServerSettings' gRPC call.
grpc::Status portIMAP(int &outPort); ///< Performs the 'portImap' gRPC call.
grpc::Status portSMTP(int &outPort); ///< Performs the 'portImap' gRPC call.
grpc::Status changePorts(int portIMAP, int portSMTP); ///< Performs the 'changePorts' gRPC call.
grpc::Status isDoHEnabled(bool &outEnabled); ///< Performs the 'isDoHEnabled' gRPC call. grpc::Status isDoHEnabled(bool &outEnabled); ///< Performs the 'isDoHEnabled' gRPC call.
grpc::Status setIsDoHEnabled(bool enabled); ///< Performs the 'setIsDoHEnabled' gRPC call. grpc::Status setIsDoHEnabled(bool enabled); ///< Performs the 'setIsDoHEnabled' gRPC call.
grpc::Status useSSLForIMAP(bool &outUseSSL); ///< Performs the 'useSSLForSMTP' gRPC call
grpc::Status setUseSSLForIMAP(bool useSSL); ///< Performs the 'currentEmailClient' gRPC call.
signals: signals:
void portIssueIMAP(); void imapPortStartupError();
void portIssueSMTP(); void smtpPortStartupError();
void toggleUseSSLFinished(); void imapPortChangeError();
void changePortFinished(); void smtpPortChangeError();
void imapConnectionModeChangeError();
void smtpConnectionModeChangeError();
void mailServerSettingsChanged(qint32 imapPort, qint32 smtpPort, bool useSSLForIMAP, bool useSSLForSMTP);
void changeMailServerSettingsFinished();
public: // login related calls public: // login related calls
grpc::Status login(QString const &username, QString const &password); ///< Performs the 'login' call. grpc::Status login(QString const &username, QString const &password); ///< Performs the 'login' call.
@ -228,7 +227,7 @@ private:
void processLoginEvent(grpc::LoginEvent const &event); ///< Process a 'Login' event. void processLoginEvent(grpc::LoginEvent const &event); ///< Process a 'Login' event.
void processUpdateEvent(grpc::UpdateEvent const &event); ///< Process an 'Update' event. void processUpdateEvent(grpc::UpdateEvent const &event); ///< Process an 'Update' event.
void processCacheEvent(grpc::DiskCacheEvent const &event); ///< Process a 'Cache' event. void processCacheEvent(grpc::DiskCacheEvent const &event); ///< Process a 'Cache' event.
void processMailSettingsEvent(grpc::MailSettingsEvent const &event); ///< Process a 'MailSettings' event. void processMailServerSettingsEvent(grpc::MailServerSettingsEvent const &event); ///< Process a 'MailSettings' event.
void processKeychainEvent(grpc::KeychainEvent const &event); ///< Process a 'Keychain' event. void processKeychainEvent(grpc::KeychainEvent const &event); ///< Process a 'Keychain' event.
void processMailEvent(grpc::MailEvent const &event); ///< Process a 'Mail' event. void processMailEvent(grpc::MailEvent const &event); ///< Process a 'Mail' event.
void processUserEvent(grpc::UserEvent const &event); ///< Process a 'User' event. void processUserEvent(grpc::UserEvent const &event); ///< Process a 'User' event.

View File

@ -62,14 +62,9 @@ static const char* Bridge_method_names[] = {
"/grpc.Bridge/SetDiskCachePath", "/grpc.Bridge/SetDiskCachePath",
"/grpc.Bridge/SetIsDoHEnabled", "/grpc.Bridge/SetIsDoHEnabled",
"/grpc.Bridge/IsDoHEnabled", "/grpc.Bridge/IsDoHEnabled",
"/grpc.Bridge/SetUseSslForSmtp", "/grpc.Bridge/MailServerSettings",
"/grpc.Bridge/UseSslForSmtp", "/grpc.Bridge/SetMailServerSettings",
"/grpc.Bridge/SetUseSslForImap",
"/grpc.Bridge/UseSslForImap",
"/grpc.Bridge/Hostname", "/grpc.Bridge/Hostname",
"/grpc.Bridge/ImapPort",
"/grpc.Bridge/SmtpPort",
"/grpc.Bridge/ChangePorts",
"/grpc.Bridge/IsPortFree", "/grpc.Bridge/IsPortFree",
"/grpc.Bridge/AvailableKeychains", "/grpc.Bridge/AvailableKeychains",
"/grpc.Bridge/SetCurrentKeychain", "/grpc.Bridge/SetCurrentKeychain",
@ -131,26 +126,21 @@ Bridge::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, co
, rpcmethod_SetDiskCachePath_(Bridge_method_names[37], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_SetDiskCachePath_(Bridge_method_names[37], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_SetIsDoHEnabled_(Bridge_method_names[38], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_SetIsDoHEnabled_(Bridge_method_names[38], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_IsDoHEnabled_(Bridge_method_names[39], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_IsDoHEnabled_(Bridge_method_names[39], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_SetUseSslForSmtp_(Bridge_method_names[40], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_MailServerSettings_(Bridge_method_names[40], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_UseSslForSmtp_(Bridge_method_names[41], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_SetMailServerSettings_(Bridge_method_names[41], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_SetUseSslForImap_(Bridge_method_names[42], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_Hostname_(Bridge_method_names[42], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_UseSslForImap_(Bridge_method_names[43], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_IsPortFree_(Bridge_method_names[43], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_Hostname_(Bridge_method_names[44], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_AvailableKeychains_(Bridge_method_names[44], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_ImapPort_(Bridge_method_names[45], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_SetCurrentKeychain_(Bridge_method_names[45], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_SmtpPort_(Bridge_method_names[46], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_CurrentKeychain_(Bridge_method_names[46], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_ChangePorts_(Bridge_method_names[47], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_GetUserList_(Bridge_method_names[47], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_IsPortFree_(Bridge_method_names[48], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_GetUser_(Bridge_method_names[48], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_AvailableKeychains_(Bridge_method_names[49], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_SetUserSplitMode_(Bridge_method_names[49], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_SetCurrentKeychain_(Bridge_method_names[50], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_LogoutUser_(Bridge_method_names[50], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_CurrentKeychain_(Bridge_method_names[51], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_RemoveUser_(Bridge_method_names[51], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_GetUserList_(Bridge_method_names[52], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_ConfigureUserAppleMail_(Bridge_method_names[52], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_GetUser_(Bridge_method_names[53], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_RunEventStream_(Bridge_method_names[53], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
, rpcmethod_SetUserSplitMode_(Bridge_method_names[54], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_StopEventStream_(Bridge_method_names[54], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_LogoutUser_(Bridge_method_names[55], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_RemoveUser_(Bridge_method_names[56], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_ConfigureUserAppleMail_(Bridge_method_names[57], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_RunEventStream_(Bridge_method_names[58], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
, rpcmethod_StopEventStream_(Bridge_method_names[59], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
{} {}
::grpc::Status Bridge::Stub::CheckTokens(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::StringValue* response) { ::grpc::Status Bridge::Stub::CheckTokens(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::StringValue* response) {
@ -1073,94 +1063,48 @@ void Bridge::Stub::async::IsDoHEnabled(::grpc::ClientContext* context, const ::g
return result; return result;
} }
::grpc::Status Bridge::Stub::SetUseSslForSmtp(::grpc::ClientContext* context, const ::google::protobuf::BoolValue& request, ::google::protobuf::Empty* response) { ::grpc::Status Bridge::Stub::MailServerSettings(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::ImapSmtpSettings* response) {
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SetUseSslForSmtp_, context, request, response); return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Empty, ::grpc::ImapSmtpSettings, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_MailServerSettings_, context, request, response);
} }
void Bridge::Stub::async::SetUseSslForSmtp(::grpc::ClientContext* context, const ::google::protobuf::BoolValue* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)> f) { void Bridge::Stub::async::MailServerSettings(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::grpc::ImapSmtpSettings* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetUseSslForSmtp_, context, request, response, std::move(f)); ::grpc::internal::CallbackUnaryCall< ::google::protobuf::Empty, ::grpc::ImapSmtpSettings, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_MailServerSettings_, context, request, response, std::move(f));
} }
void Bridge::Stub::async::SetUseSslForSmtp(::grpc::ClientContext* context, const ::google::protobuf::BoolValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) { void Bridge::Stub::async::MailServerSettings(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::grpc::ImapSmtpSettings* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetUseSslForSmtp_, context, request, response, reactor); ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_MailServerSettings_, context, request, response, reactor);
} }
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::PrepareAsyncSetUseSslForSmtpRaw(::grpc::ClientContext* context, const ::google::protobuf::BoolValue& request, ::grpc::CompletionQueue* cq) { ::grpc::ClientAsyncResponseReader< ::grpc::ImapSmtpSettings>* Bridge::Stub::PrepareAsyncMailServerSettingsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_SetUseSslForSmtp_, context, request); return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::grpc::ImapSmtpSettings, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_MailServerSettings_, context, request);
} }
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::AsyncSetUseSslForSmtpRaw(::grpc::ClientContext* context, const ::google::protobuf::BoolValue& request, ::grpc::CompletionQueue* cq) { ::grpc::ClientAsyncResponseReader< ::grpc::ImapSmtpSettings>* Bridge::Stub::AsyncMailServerSettingsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
auto* result = auto* result =
this->PrepareAsyncSetUseSslForSmtpRaw(context, request, cq); this->PrepareAsyncMailServerSettingsRaw(context, request, cq);
result->StartCall(); result->StartCall();
return result; return result;
} }
::grpc::Status Bridge::Stub::UseSslForSmtp(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::BoolValue* response) { ::grpc::Status Bridge::Stub::SetMailServerSettings(::grpc::ClientContext* context, const ::grpc::ImapSmtpSettings& request, ::google::protobuf::Empty* response) {
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_UseSslForSmtp_, context, request, response); return ::grpc::internal::BlockingUnaryCall< ::grpc::ImapSmtpSettings, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SetMailServerSettings_, context, request, response);
} }
void Bridge::Stub::async::UseSslForSmtp(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::BoolValue* response, std::function<void(::grpc::Status)> f) { void Bridge::Stub::async::SetMailServerSettings(::grpc::ClientContext* context, const ::grpc::ImapSmtpSettings* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UseSslForSmtp_, context, request, response, std::move(f)); ::grpc::internal::CallbackUnaryCall< ::grpc::ImapSmtpSettings, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetMailServerSettings_, context, request, response, std::move(f));
} }
void Bridge::Stub::async::UseSslForSmtp(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::BoolValue* response, ::grpc::ClientUnaryReactor* reactor) { void Bridge::Stub::async::SetMailServerSettings(::grpc::ClientContext* context, const ::grpc::ImapSmtpSettings* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UseSslForSmtp_, context, request, response, reactor); ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetMailServerSettings_, context, request, response, reactor);
} }
::grpc::ClientAsyncResponseReader< ::google::protobuf::BoolValue>* Bridge::Stub::PrepareAsyncUseSslForSmtpRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::PrepareAsyncSetMailServerSettingsRaw(::grpc::ClientContext* context, const ::grpc::ImapSmtpSettings& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_UseSslForSmtp_, context, request); return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::grpc::ImapSmtpSettings, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_SetMailServerSettings_, context, request);
} }
::grpc::ClientAsyncResponseReader< ::google::protobuf::BoolValue>* Bridge::Stub::AsyncUseSslForSmtpRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::AsyncSetMailServerSettingsRaw(::grpc::ClientContext* context, const ::grpc::ImapSmtpSettings& request, ::grpc::CompletionQueue* cq) {
auto* result = auto* result =
this->PrepareAsyncUseSslForSmtpRaw(context, request, cq); this->PrepareAsyncSetMailServerSettingsRaw(context, request, cq);
result->StartCall();
return result;
}
::grpc::Status Bridge::Stub::SetUseSslForImap(::grpc::ClientContext* context, const ::google::protobuf::BoolValue& request, ::google::protobuf::Empty* response) {
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SetUseSslForImap_, context, request, response);
}
void Bridge::Stub::async::SetUseSslForImap(::grpc::ClientContext* context, const ::google::protobuf::BoolValue* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetUseSslForImap_, context, request, response, std::move(f));
}
void Bridge::Stub::async::SetUseSslForImap(::grpc::ClientContext* context, const ::google::protobuf::BoolValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetUseSslForImap_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::PrepareAsyncSetUseSslForImapRaw(::grpc::ClientContext* context, const ::google::protobuf::BoolValue& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_SetUseSslForImap_, context, request);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::AsyncSetUseSslForImapRaw(::grpc::ClientContext* context, const ::google::protobuf::BoolValue& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncSetUseSslForImapRaw(context, request, cq);
result->StartCall();
return result;
}
::grpc::Status Bridge::Stub::UseSslForImap(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::BoolValue* response) {
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_UseSslForImap_, context, request, response);
}
void Bridge::Stub::async::UseSslForImap(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::BoolValue* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UseSslForImap_, context, request, response, std::move(f));
}
void Bridge::Stub::async::UseSslForImap(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::BoolValue* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UseSslForImap_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::BoolValue>* Bridge::Stub::PrepareAsyncUseSslForImapRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_UseSslForImap_, context, request);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::BoolValue>* Bridge::Stub::AsyncUseSslForImapRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncUseSslForImapRaw(context, request, cq);
result->StartCall(); result->StartCall();
return result; return result;
} }
@ -1188,75 +1132,6 @@ void Bridge::Stub::async::Hostname(::grpc::ClientContext* context, const ::googl
return result; return result;
} }
::grpc::Status Bridge::Stub::ImapPort(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Int32Value* response) {
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Int32Value, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ImapPort_, context, request, response);
}
void Bridge::Stub::async::ImapPort(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Int32Value* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Int32Value, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ImapPort_, context, request, response, std::move(f));
}
void Bridge::Stub::async::ImapPort(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Int32Value* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ImapPort_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Int32Value>* Bridge::Stub::PrepareAsyncImapPortRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Int32Value, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_ImapPort_, context, request);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Int32Value>* Bridge::Stub::AsyncImapPortRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncImapPortRaw(context, request, cq);
result->StartCall();
return result;
}
::grpc::Status Bridge::Stub::SmtpPort(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Int32Value* response) {
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Int32Value, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SmtpPort_, context, request, response);
}
void Bridge::Stub::async::SmtpPort(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Int32Value* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Int32Value, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SmtpPort_, context, request, response, std::move(f));
}
void Bridge::Stub::async::SmtpPort(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Int32Value* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SmtpPort_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Int32Value>* Bridge::Stub::PrepareAsyncSmtpPortRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Int32Value, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_SmtpPort_, context, request);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Int32Value>* Bridge::Stub::AsyncSmtpPortRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncSmtpPortRaw(context, request, cq);
result->StartCall();
return result;
}
::grpc::Status Bridge::Stub::ChangePorts(::grpc::ClientContext* context, const ::grpc::ChangePortsRequest& request, ::google::protobuf::Empty* response) {
return ::grpc::internal::BlockingUnaryCall< ::grpc::ChangePortsRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ChangePorts_, context, request, response);
}
void Bridge::Stub::async::ChangePorts(::grpc::ClientContext* context, const ::grpc::ChangePortsRequest* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::grpc::ChangePortsRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ChangePorts_, context, request, response, std::move(f));
}
void Bridge::Stub::async::ChangePorts(::grpc::ClientContext* context, const ::grpc::ChangePortsRequest* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ChangePorts_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::PrepareAsyncChangePortsRaw(::grpc::ClientContext* context, const ::grpc::ChangePortsRequest& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::grpc::ChangePortsRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_ChangePorts_, context, request);
}
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::AsyncChangePortsRaw(::grpc::ClientContext* context, const ::grpc::ChangePortsRequest& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncChangePortsRaw(context, request, cq);
result->StartCall();
return result;
}
::grpc::Status Bridge::Stub::IsPortFree(::grpc::ClientContext* context, const ::google::protobuf::Int32Value& request, ::google::protobuf::BoolValue* response) { ::grpc::Status Bridge::Stub::IsPortFree(::grpc::ClientContext* context, const ::google::protobuf::Int32Value& request, ::google::protobuf::BoolValue* response) {
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Int32Value, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_IsPortFree_, context, request, response); return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Int32Value, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_IsPortFree_, context, request, response);
} }
@ -1930,46 +1805,26 @@ Bridge::Service::Service() {
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[40], Bridge_method_names[40],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::grpc::ImapSmtpSettings, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
::grpc::ServerContext* ctx, ::grpc::ServerContext* ctx,
const ::google::protobuf::BoolValue* req, const ::google::protobuf::Empty* req,
::google::protobuf::Empty* resp) { ::grpc::ImapSmtpSettings* resp) {
return service->SetUseSslForSmtp(ctx, req, resp); return service->MailServerSettings(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[41], Bridge_method_names[41],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::grpc::ImapSmtpSettings, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
::grpc::ServerContext* ctx, ::grpc::ServerContext* ctx,
const ::google::protobuf::Empty* req, const ::grpc::ImapSmtpSettings* req,
::google::protobuf::BoolValue* resp) { ::google::protobuf::Empty* resp) {
return service->UseSslForSmtp(ctx, req, resp); return service->SetMailServerSettings(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[42], Bridge_method_names[42],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::BoolValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service,
::grpc::ServerContext* ctx,
const ::google::protobuf::BoolValue* req,
::google::protobuf::Empty* resp) {
return service->SetUseSslForImap(ctx, req, resp);
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[43],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service,
::grpc::ServerContext* ctx,
const ::google::protobuf::Empty* req,
::google::protobuf::BoolValue* resp) {
return service->UseSslForImap(ctx, req, resp);
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[44],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
::grpc::ServerContext* ctx, ::grpc::ServerContext* ctx,
@ -1978,37 +1833,7 @@ Bridge::Service::Service() {
return service->Hostname(ctx, req, resp); return service->Hostname(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[45], Bridge_method_names[43],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::Int32Value, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service,
::grpc::ServerContext* ctx,
const ::google::protobuf::Empty* req,
::google::protobuf::Int32Value* resp) {
return service->ImapPort(ctx, req, resp);
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[46],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::Int32Value, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service,
::grpc::ServerContext* ctx,
const ::google::protobuf::Empty* req,
::google::protobuf::Int32Value* resp) {
return service->SmtpPort(ctx, req, resp);
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[47],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::grpc::ChangePortsRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service,
::grpc::ServerContext* ctx,
const ::grpc::ChangePortsRequest* req,
::google::protobuf::Empty* resp) {
return service->ChangePorts(ctx, req, resp);
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[48],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Int32Value, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Int32Value, ::google::protobuf::BoolValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2018,7 +1843,7 @@ Bridge::Service::Service() {
return service->IsPortFree(ctx, req, resp); return service->IsPortFree(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[49], Bridge_method_names[44],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::grpc::AvailableKeychainsResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::grpc::AvailableKeychainsResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2028,7 +1853,7 @@ Bridge::Service::Service() {
return service->AvailableKeychains(ctx, req, resp); return service->AvailableKeychains(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[50], Bridge_method_names[45],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2038,7 +1863,7 @@ Bridge::Service::Service() {
return service->SetCurrentKeychain(ctx, req, resp); return service->SetCurrentKeychain(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[51], Bridge_method_names[46],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2048,7 +1873,7 @@ Bridge::Service::Service() {
return service->CurrentKeychain(ctx, req, resp); return service->CurrentKeychain(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[52], Bridge_method_names[47],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::grpc::UserListResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::grpc::UserListResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2058,7 +1883,7 @@ Bridge::Service::Service() {
return service->GetUserList(ctx, req, resp); return service->GetUserList(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[53], Bridge_method_names[48],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::grpc::User, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::grpc::User, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2068,7 +1893,7 @@ Bridge::Service::Service() {
return service->GetUser(ctx, req, resp); return service->GetUser(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[54], Bridge_method_names[49],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::grpc::UserSplitModeRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::grpc::UserSplitModeRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2078,7 +1903,7 @@ Bridge::Service::Service() {
return service->SetUserSplitMode(ctx, req, resp); return service->SetUserSplitMode(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[55], Bridge_method_names[50],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2088,7 +1913,7 @@ Bridge::Service::Service() {
return service->LogoutUser(ctx, req, resp); return service->LogoutUser(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[56], Bridge_method_names[51],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2098,7 +1923,7 @@ Bridge::Service::Service() {
return service->RemoveUser(ctx, req, resp); return service->RemoveUser(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[57], Bridge_method_names[52],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::grpc::ConfigureAppleMailRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::grpc::ConfigureAppleMailRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2108,7 +1933,7 @@ Bridge::Service::Service() {
return service->ConfigureUserAppleMail(ctx, req, resp); return service->ConfigureUserAppleMail(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[58], Bridge_method_names[53],
::grpc::internal::RpcMethod::SERVER_STREAMING, ::grpc::internal::RpcMethod::SERVER_STREAMING,
new ::grpc::internal::ServerStreamingHandler< Bridge::Service, ::grpc::EventStreamRequest, ::grpc::StreamEvent>( new ::grpc::internal::ServerStreamingHandler< Bridge::Service, ::grpc::EventStreamRequest, ::grpc::StreamEvent>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2118,7 +1943,7 @@ Bridge::Service::Service() {
return service->RunEventStream(ctx, req, writer); return service->RunEventStream(ctx, req, writer);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Bridge_method_names[59], Bridge_method_names[54],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Bridge::Service* service, [](Bridge::Service* service,
@ -2412,28 +2237,14 @@ Bridge::Service::~Service() {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
::grpc::Status Bridge::Service::SetUseSslForSmtp(::grpc::ServerContext* context, const ::google::protobuf::BoolValue* request, ::google::protobuf::Empty* response) { ::grpc::Status Bridge::Service::MailServerSettings(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::grpc::ImapSmtpSettings* response) {
(void) context; (void) context;
(void) request; (void) request;
(void) response; (void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
::grpc::Status Bridge::Service::UseSslForSmtp(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::BoolValue* response) { ::grpc::Status Bridge::Service::SetMailServerSettings(::grpc::ServerContext* context, const ::grpc::ImapSmtpSettings* request, ::google::protobuf::Empty* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
::grpc::Status Bridge::Service::SetUseSslForImap(::grpc::ServerContext* context, const ::google::protobuf::BoolValue* request, ::google::protobuf::Empty* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
::grpc::Status Bridge::Service::UseSslForImap(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::BoolValue* response) {
(void) context; (void) context;
(void) request; (void) request;
(void) response; (void) response;
@ -2447,27 +2258,6 @@ Bridge::Service::~Service() {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
::grpc::Status Bridge::Service::ImapPort(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Int32Value* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
::grpc::Status Bridge::Service::SmtpPort(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Int32Value* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
::grpc::Status Bridge::Service::ChangePorts(::grpc::ServerContext* context, const ::grpc::ChangePortsRequest* request, ::google::protobuf::Empty* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
::grpc::Status Bridge::Service::IsPortFree(::grpc::ServerContext* context, const ::google::protobuf::Int32Value* request, ::google::protobuf::BoolValue* response) { ::grpc::Status Bridge::Service::IsPortFree(::grpc::ServerContext* context, const ::google::protobuf::Int32Value* request, ::google::protobuf::BoolValue* response) {
(void) context; (void) context;
(void) request; (void) request;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -78,14 +78,9 @@ service Bridge {
// mail // mail
rpc SetIsDoHEnabled(google.protobuf.BoolValue) returns (google.protobuf.Empty); rpc SetIsDoHEnabled(google.protobuf.BoolValue) returns (google.protobuf.Empty);
rpc IsDoHEnabled(google.protobuf.Empty) returns (google.protobuf.BoolValue); rpc IsDoHEnabled(google.protobuf.Empty) returns (google.protobuf.BoolValue);
rpc SetUseSslForSmtp(google.protobuf.BoolValue) returns (google.protobuf.Empty); rpc MailServerSettings(google.protobuf.Empty) returns (ImapSmtpSettings);
rpc UseSslForSmtp(google.protobuf.Empty) returns (google.protobuf.BoolValue); rpc SetMailServerSettings(ImapSmtpSettings) returns (google.protobuf.Empty);
rpc SetUseSslForImap(google.protobuf.BoolValue) returns (google.protobuf.Empty);
rpc UseSslForImap(google.protobuf.Empty) returns (google.protobuf.BoolValue);
rpc Hostname(google.protobuf.Empty) returns (google.protobuf.StringValue); rpc Hostname(google.protobuf.Empty) returns (google.protobuf.StringValue);
rpc ImapPort(google.protobuf.Empty) returns (google.protobuf.Int32Value);
rpc SmtpPort(google.protobuf.Empty) returns (google.protobuf.Int32Value);
rpc ChangePorts(ChangePortsRequest) returns (google.protobuf.Empty);
rpc IsPortFree(google.protobuf.Int32Value) returns (google.protobuf.BoolValue); rpc IsPortFree(google.protobuf.Int32Value) returns (google.protobuf.BoolValue);
// keychain // keychain
@ -158,11 +153,13 @@ message LoginAbortRequest {
} }
//********************************************************** //**********************************************************
// Port related message // IMAP/SMTP Mail Server settings
//********************************************************** //**********************************************************
message ChangePortsRequest { message ImapSmtpSettings {
int32 imapPort = 1; int32 imapPort = 1;
int32 smtpPort = 2; int32 smtpPort = 2;
bool useSSLForImap = 3;
bool useSSLForSmtp = 4;
} }
//********************************************************** //**********************************************************
@ -222,7 +219,7 @@ message StreamEvent {
LoginEvent login = 2; LoginEvent login = 2;
UpdateEvent update = 3; UpdateEvent update = 3;
DiskCacheEvent cache = 4; DiskCacheEvent cache = 4;
MailSettingsEvent mailSettings = 5; MailServerSettingsEvent mailServerSettings = 5;
KeychainEvent keychain = 6; KeychainEvent keychain = 6;
MailEvent mail = 7; MailEvent mail = 7;
UserEvent user = 8; UserEvent user = 8;
@ -368,31 +365,28 @@ message DiskCachePathChangeFinishedEvent {}
//********************************************************** //**********************************************************
// Mail settings related events // Mail server settings related events
//********************************************************** //**********************************************************
message MailSettingsEvent { message MailServerSettingsEvent {
oneof event { oneof event {
MailSettingsErrorEvent error = 1; MailServerSettingsErrorEvent error = 1;
UseSslForSmtpFinishedEvent useSslForSmtpFinished = 2; MailServerSettingsChangedEvent mailServerSettingsChanged = 2;
ChangePortsFinishedEvent changePortsFinished = 3; ChangeMailServerSettingsFinishedEvent changeMailServerSettingsFinished = 3;
UseSslForImapFinishedEvent useSslForImapFinished = 4;
} }
} }
enum MailSettingsErrorType { enum MailServerSettingsErrorType {
IMAP_PORT_ISSUE = 0; IMAP_PORT_STARTUP_ERROR = 0;
SMTP_PORT_ISSUE = 1; SMTP_PORT_STARTUP_ERROR = 1;
IMAP_PORT_CHANGE_ERROR = 2;
SMTP_PORT_CHANGE_ERROR = 3;
IMAP_CONNECTION_MODE_CHANGE_ERROR = 4;
SMTP_CONNECTION_MODE_CHANGE_ERROR = 5;
} }
message MailSettingsErrorEvent { message MailServerSettingsErrorEvent { MailServerSettingsErrorType type = 1; }
MailSettingsErrorType type = 1; message MailServerSettingsChangedEvent { ImapSmtpSettings settings = 1; }
} message ChangeMailServerSettingsFinishedEvent {}
message UseSslForSmtpFinishedEvent {}
message UseSslForImapFinishedEvent {}
message ChangePortsFinishedEvent {}
//********************************************************** //**********************************************************
// keychain related events // keychain related events

View File

@ -69,14 +69,9 @@ type BridgeClient interface {
// mail // mail
SetIsDoHEnabled(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error) SetIsDoHEnabled(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
IsDoHEnabled(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) IsDoHEnabled(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
SetUseSslForSmtp(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error) MailServerSettings(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ImapSmtpSettings, error)
UseSslForSmtp(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) SetMailServerSettings(ctx context.Context, in *ImapSmtpSettings, opts ...grpc.CallOption) (*emptypb.Empty, error)
SetUseSslForImap(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
UseSslForImap(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
Hostname(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) Hostname(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
ImapPort(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error)
SmtpPort(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error)
ChangePorts(ctx context.Context, in *ChangePortsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
IsPortFree(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) IsPortFree(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
// keychain // keychain
AvailableKeychains(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AvailableKeychainsResponse, error) AvailableKeychains(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AvailableKeychainsResponse, error)
@ -462,36 +457,18 @@ func (c *bridgeClient) IsDoHEnabled(ctx context.Context, in *emptypb.Empty, opts
return out, nil return out, nil
} }
func (c *bridgeClient) SetUseSslForSmtp(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { func (c *bridgeClient) MailServerSettings(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ImapSmtpSettings, error) {
out := new(ImapSmtpSettings)
err := c.cc.Invoke(ctx, "/grpc.Bridge/MailServerSettings", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) SetMailServerSettings(ctx context.Context, in *ImapSmtpSettings, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty) out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/grpc.Bridge/SetUseSslForSmtp", in, out, opts...) err := c.cc.Invoke(ctx, "/grpc.Bridge/SetMailServerSettings", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) UseSslForSmtp(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
out := new(wrapperspb.BoolValue)
err := c.cc.Invoke(ctx, "/grpc.Bridge/UseSslForSmtp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) SetUseSslForImap(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/grpc.Bridge/SetUseSslForImap", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) UseSslForImap(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
out := new(wrapperspb.BoolValue)
err := c.cc.Invoke(ctx, "/grpc.Bridge/UseSslForImap", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -507,33 +484,6 @@ func (c *bridgeClient) Hostname(ctx context.Context, in *emptypb.Empty, opts ...
return out, nil return out, nil
} }
func (c *bridgeClient) ImapPort(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error) {
out := new(wrapperspb.Int32Value)
err := c.cc.Invoke(ctx, "/grpc.Bridge/ImapPort", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) SmtpPort(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error) {
out := new(wrapperspb.Int32Value)
err := c.cc.Invoke(ctx, "/grpc.Bridge/SmtpPort", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) ChangePorts(ctx context.Context, in *ChangePortsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/grpc.Bridge/ChangePorts", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) IsPortFree(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) { func (c *bridgeClient) IsPortFree(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
out := new(wrapperspb.BoolValue) out := new(wrapperspb.BoolValue)
err := c.cc.Invoke(ctx, "/grpc.Bridge/IsPortFree", in, out, opts...) err := c.cc.Invoke(ctx, "/grpc.Bridge/IsPortFree", in, out, opts...)
@ -714,14 +664,9 @@ type BridgeServer interface {
// mail // mail
SetIsDoHEnabled(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error) SetIsDoHEnabled(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error)
IsDoHEnabled(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) IsDoHEnabled(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error)
SetUseSslForSmtp(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error) MailServerSettings(context.Context, *emptypb.Empty) (*ImapSmtpSettings, error)
UseSslForSmtp(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) SetMailServerSettings(context.Context, *ImapSmtpSettings) (*emptypb.Empty, error)
SetUseSslForImap(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error)
UseSslForImap(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error)
Hostname(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error) Hostname(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error)
ImapPort(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error)
SmtpPort(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error)
ChangePorts(context.Context, *ChangePortsRequest) (*emptypb.Empty, error)
IsPortFree(context.Context, *wrapperspb.Int32Value) (*wrapperspb.BoolValue, error) IsPortFree(context.Context, *wrapperspb.Int32Value) (*wrapperspb.BoolValue, error)
// keychain // keychain
AvailableKeychains(context.Context, *emptypb.Empty) (*AvailableKeychainsResponse, error) AvailableKeychains(context.Context, *emptypb.Empty) (*AvailableKeychainsResponse, error)
@ -864,30 +809,15 @@ func (UnimplementedBridgeServer) SetIsDoHEnabled(context.Context, *wrapperspb.Bo
func (UnimplementedBridgeServer) IsDoHEnabled(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) { func (UnimplementedBridgeServer) IsDoHEnabled(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) {
return nil, status.Errorf(codes.Unimplemented, "method IsDoHEnabled not implemented") return nil, status.Errorf(codes.Unimplemented, "method IsDoHEnabled not implemented")
} }
func (UnimplementedBridgeServer) SetUseSslForSmtp(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error) { func (UnimplementedBridgeServer) MailServerSettings(context.Context, *emptypb.Empty) (*ImapSmtpSettings, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetUseSslForSmtp not implemented") return nil, status.Errorf(codes.Unimplemented, "method MailServerSettings not implemented")
} }
func (UnimplementedBridgeServer) UseSslForSmtp(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) { func (UnimplementedBridgeServer) SetMailServerSettings(context.Context, *ImapSmtpSettings) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UseSslForSmtp not implemented") return nil, status.Errorf(codes.Unimplemented, "method SetMailServerSettings not implemented")
}
func (UnimplementedBridgeServer) SetUseSslForImap(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetUseSslForImap not implemented")
}
func (UnimplementedBridgeServer) UseSslForImap(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) {
return nil, status.Errorf(codes.Unimplemented, "method UseSslForImap not implemented")
} }
func (UnimplementedBridgeServer) Hostname(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error) { func (UnimplementedBridgeServer) Hostname(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error) {
return nil, status.Errorf(codes.Unimplemented, "method Hostname not implemented") return nil, status.Errorf(codes.Unimplemented, "method Hostname not implemented")
} }
func (UnimplementedBridgeServer) ImapPort(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error) {
return nil, status.Errorf(codes.Unimplemented, "method ImapPort not implemented")
}
func (UnimplementedBridgeServer) SmtpPort(context.Context, *emptypb.Empty) (*wrapperspb.Int32Value, error) {
return nil, status.Errorf(codes.Unimplemented, "method SmtpPort not implemented")
}
func (UnimplementedBridgeServer) ChangePorts(context.Context, *ChangePortsRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangePorts not implemented")
}
func (UnimplementedBridgeServer) IsPortFree(context.Context, *wrapperspb.Int32Value) (*wrapperspb.BoolValue, error) { func (UnimplementedBridgeServer) IsPortFree(context.Context, *wrapperspb.Int32Value) (*wrapperspb.BoolValue, error) {
return nil, status.Errorf(codes.Unimplemented, "method IsPortFree not implemented") return nil, status.Errorf(codes.Unimplemented, "method IsPortFree not implemented")
} }
@ -1657,74 +1587,38 @@ func _Bridge_IsDoHEnabled_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Bridge_SetUseSslForSmtp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Bridge_MailServerSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(wrapperspb.BoolValue)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BridgeServer).SetUseSslForSmtp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.Bridge/SetUseSslForSmtp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).SetUseSslForSmtp(ctx, req.(*wrapperspb.BoolValue))
}
return interceptor(ctx, in, info, handler)
}
func _Bridge_UseSslForSmtp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty) in := new(emptypb.Empty)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(BridgeServer).UseSslForSmtp(ctx, in) return srv.(BridgeServer).MailServerSettings(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/grpc.Bridge/UseSslForSmtp", FullMethod: "/grpc.Bridge/MailServerSettings",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).UseSslForSmtp(ctx, req.(*emptypb.Empty)) return srv.(BridgeServer).MailServerSettings(ctx, req.(*emptypb.Empty))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Bridge_SetUseSslForImap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Bridge_SetMailServerSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(wrapperspb.BoolValue) in := new(ImapSmtpSettings)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(BridgeServer).SetUseSslForImap(ctx, in) return srv.(BridgeServer).SetMailServerSettings(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/grpc.Bridge/SetUseSslForImap", FullMethod: "/grpc.Bridge/SetMailServerSettings",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).SetUseSslForImap(ctx, req.(*wrapperspb.BoolValue)) return srv.(BridgeServer).SetMailServerSettings(ctx, req.(*ImapSmtpSettings))
}
return interceptor(ctx, in, info, handler)
}
func _Bridge_UseSslForImap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BridgeServer).UseSslForImap(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.Bridge/UseSslForImap",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).UseSslForImap(ctx, req.(*emptypb.Empty))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -1747,60 +1641,6 @@ func _Bridge_Hostname_Handler(srv interface{}, ctx context.Context, dec func(int
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Bridge_ImapPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BridgeServer).ImapPort(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.Bridge/ImapPort",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).ImapPort(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Bridge_SmtpPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BridgeServer).SmtpPort(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.Bridge/SmtpPort",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).SmtpPort(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Bridge_ChangePorts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangePortsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BridgeServer).ChangePorts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.Bridge/ChangePorts",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).ChangePorts(ctx, req.(*ChangePortsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Bridge_IsPortFree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Bridge_IsPortFree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(wrapperspb.Int32Value) in := new(wrapperspb.Int32Value)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -2188,37 +2028,17 @@ var Bridge_ServiceDesc = grpc.ServiceDesc{
Handler: _Bridge_IsDoHEnabled_Handler, Handler: _Bridge_IsDoHEnabled_Handler,
}, },
{ {
MethodName: "SetUseSslForSmtp", MethodName: "MailServerSettings",
Handler: _Bridge_SetUseSslForSmtp_Handler, Handler: _Bridge_MailServerSettings_Handler,
}, },
{ {
MethodName: "UseSslForSmtp", MethodName: "SetMailServerSettings",
Handler: _Bridge_UseSslForSmtp_Handler, Handler: _Bridge_SetMailServerSettings_Handler,
},
{
MethodName: "SetUseSslForImap",
Handler: _Bridge_SetUseSslForImap_Handler,
},
{
MethodName: "UseSslForImap",
Handler: _Bridge_UseSslForImap_Handler,
}, },
{ {
MethodName: "Hostname", MethodName: "Hostname",
Handler: _Bridge_Hostname_Handler, Handler: _Bridge_Hostname_Handler,
}, },
{
MethodName: "ImapPort",
Handler: _Bridge_ImapPort_Handler,
},
{
MethodName: "SmtpPort",
Handler: _Bridge_SmtpPort_Handler,
},
{
MethodName: "ChangePorts",
Handler: _Bridge_ChangePorts_Handler,
},
{ {
MethodName: "IsPortFree", MethodName: "IsPortFree",
Handler: _Bridge_IsPortFree_Handler, Handler: _Bridge_IsPortFree_Handler,

View File

@ -109,20 +109,28 @@ func NewDiskCachePathChangeFinishedEvent() *StreamEvent {
return cacheEvent(&DiskCacheEvent{Event: &DiskCacheEvent_PathChangeFinished{PathChangeFinished: &DiskCachePathChangeFinishedEvent{}}}) return cacheEvent(&DiskCacheEvent{Event: &DiskCacheEvent_PathChangeFinished{PathChangeFinished: &DiskCachePathChangeFinishedEvent{}}})
} }
func NewMailSettingsErrorEvent(err MailSettingsErrorType) *StreamEvent { func NewMailServerSettingsErrorEvent(err MailServerSettingsErrorType) *StreamEvent {
return mailSettingsEvent(&MailSettingsEvent{Event: &MailSettingsEvent_Error{Error: &MailSettingsErrorEvent{Type: err}}}) return mailServerSettingsEvent(&MailServerSettingsEvent{
Event: &MailServerSettingsEvent_Error{
Error: &MailServerSettingsErrorEvent{Type: err},
},
})
} }
func NewMailSettingsUseSslForSmtpFinishedEvent() *StreamEvent { //nolint:revive,stylecheck func NewMailServerSettingsChangedEvent(settings *ImapSmtpSettings) *StreamEvent {
return mailSettingsEvent(&MailSettingsEvent{Event: &MailSettingsEvent_UseSslForSmtpFinished{UseSslForSmtpFinished: &UseSslForSmtpFinishedEvent{}}}) return mailServerSettingsEvent(&MailServerSettingsEvent{
Event: &MailServerSettingsEvent_MailServerSettingsChanged{
MailServerSettingsChanged: &MailServerSettingsChangedEvent{Settings: settings},
},
})
} }
func NewMailSettingsUseSslForImapFinishedEvent() *StreamEvent { //nolint:revive,stylecheck func NewChangeMailServerSettingsFinishedEvent() *StreamEvent {
return mailSettingsEvent(&MailSettingsEvent{Event: &MailSettingsEvent_UseSslForImapFinished{UseSslForImapFinished: &UseSslForImapFinishedEvent{}}}) return mailServerSettingsEvent(&MailServerSettingsEvent{
} Event: &MailServerSettingsEvent_ChangeMailServerSettingsFinished{
ChangeMailServerSettingsFinished: &ChangeMailServerSettingsFinishedEvent{},
func NewMailSettingsChangePortFinishedEvent() *StreamEvent { },
return mailSettingsEvent(&MailSettingsEvent{Event: &MailSettingsEvent_ChangePortsFinished{ChangePortsFinished: &ChangePortsFinishedEvent{}}}) })
} }
func NewKeychainChangeKeychainFinishedEvent() *StreamEvent { func NewKeychainChangeKeychainFinishedEvent() *StreamEvent {
@ -183,8 +191,8 @@ func cacheEvent(event *DiskCacheEvent) *StreamEvent {
return &StreamEvent{Event: &StreamEvent_Cache{Cache: event}} return &StreamEvent{Event: &StreamEvent_Cache{Cache: event}}
} }
func mailSettingsEvent(event *MailSettingsEvent) *StreamEvent { func mailServerSettingsEvent(event *MailServerSettingsEvent) *StreamEvent {
return &StreamEvent{Event: &StreamEvent_MailSettings{MailSettings: event}} return &StreamEvent{Event: &StreamEvent_MailServerSettings{MailServerSettings: event}}
} }
func keychainEvent(event *KeychainEvent) *StreamEvent { func keychainEvent(event *KeychainEvent) *StreamEvent {

View File

@ -218,10 +218,10 @@ func (s *Service) watchEvents() {
_ = s.SendEvent(NewKeychainHasNoKeychainEvent()) _ = s.SendEvent(NewKeychainHasNoKeychainEvent())
case errors.Is(err, bridge.ErrServeIMAP): case errors.Is(err, bridge.ErrServeIMAP):
_ = s.SendEvent(NewMailSettingsErrorEvent(MailSettingsErrorType_IMAP_PORT_ISSUE)) _ = s.SendEvent(NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_IMAP_PORT_STARTUP_ERROR))
case errors.Is(err, bridge.ErrServeSMTP): case errors.Is(err, bridge.ErrServeSMTP):
_ = s.SendEvent(NewMailSettingsErrorEvent(MailSettingsErrorType_SMTP_PORT_ISSUE)) _ = s.SendEvent(NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_SMTP_PORT_STARTUP_ERROR))
} }
} }

View File

@ -37,6 +37,7 @@ import (
"golang.org/x/exp/maps" "golang.org/x/exp/maps"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"google.golang.org/protobuf/runtime/protoimpl"
"google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/wrapperspb" "google.golang.org/protobuf/types/known/wrapperspb"
) )
@ -617,46 +618,66 @@ func (s *Service) IsDoHEnabled(ctx context.Context, _ *emptypb.Empty) (*wrappers
return wrapperspb.Bool(s.bridge.GetProxyAllowed()), nil return wrapperspb.Bool(s.bridge.GetProxyAllowed()), nil
} }
func (s *Service) SetUseSslForSmtp(ctx context.Context, useSsl *wrapperspb.BoolValue) (*emptypb.Empty, error) { //nolint:revive,stylecheck func (s *Service) MailServerSettings(_ context.Context, _ *emptypb.Empty) (*ImapSmtpSettings, error) {
s.log.WithField("useSsl", useSsl.Value).Debug("SetUseSslForSmtp") s.log.Debug("ConnectionMode")
if s.bridge.GetSMTPSSL() == useSsl.Value { return &ImapSmtpSettings{
return &emptypb.Empty{}, nil state: protoimpl.MessageState{},
} sizeCache: 0,
unknownFields: nil,
if err := s.bridge.SetSMTPSSL(useSsl.Value); err != nil { ImapPort: int32(s.bridge.GetIMAPPort()),
s.log.WithError(err).Error("Failed to set SMTP SSL") SmtpPort: int32(s.bridge.GetSMTPPort()),
return nil, status.Errorf(codes.Internal, "failed to set SMTP SSL: %v", err) UseSSLForImap: s.bridge.GetIMAPSSL(),
} UseSSLForSmtp: s.bridge.GetSMTPSSL(),
}, nil
return &emptypb.Empty{}, s.SendEvent(NewMailSettingsUseSslForSmtpFinishedEvent())
} }
func (s *Service) UseSslForSmtp(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.BoolValue, error) { //nolint:revive,stylecheck func (s *Service) SetMailServerSettings(_ context.Context, settings *ImapSmtpSettings) (*emptypb.Empty, error) {
s.log.Debug("UseSslForSmtp") s.log.
WithField("ImapPort", settings.ImapPort).
WithField("SmtpPort", settings.SmtpPort).
WithField("UseSSUseSSLForIMAP", settings.UseSSLForImap).
WithField("UseSSLForSMTP", settings.UseSSLForSmtp).
Debug("SetConnectionMode")
return wrapperspb.Bool(s.bridge.GetSMTPSSL()), nil defer func() { _ = s.SendEvent(NewChangeMailServerSettingsFinishedEvent()) }()
}
func (s *Service) SetUseSslForImap(ctx context.Context, useSsl *wrapperspb.BoolValue) (*emptypb.Empty, error) { //nolint:revive,stylecheck if s.bridge.GetIMAPSSL() != settings.UseSSLForImap {
s.log.WithField("useSsl", useSsl.Value).Debug("SetUseSslForImap") if err := s.bridge.SetIMAPSSL(settings.UseSSLForImap); err != nil {
s.log.WithError(err).Error("Failed to set IMAP SSL")
if s.bridge.GetIMAPSSL() == useSsl.Value { _ = s.SendEvent(NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_IMAP_CONNECTION_MODE_CHANGE_ERROR))
return &emptypb.Empty{}, nil }
} }
if err := s.bridge.SetIMAPSSL(useSsl.Value); err != nil { if s.bridge.GetSMTPSSL() != settings.UseSSLForSmtp {
s.log.WithError(err).Error("Failed to set IMAP SSL") if err := s.bridge.SetSMTPSSL(settings.UseSSLForSmtp); err != nil {
return nil, status.Errorf(codes.Internal, "failed to set IMAP SSL: %v", err) s.log.WithError(err).Error("Failed to set SMTP SSL")
_ = s.SendEvent(NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_SMTP_CONNECTION_MODE_CHANGE_ERROR))
}
} }
return &emptypb.Empty{}, s.SendEvent(NewMailSettingsUseSslForImapFinishedEvent()) if s.bridge.GetIMAPPort() != int(settings.ImapPort) {
} if err := s.bridge.SetIMAPPort(int(settings.ImapPort)); err != nil {
s.log.WithError(err).Error("Failed to set IMAP port")
_ = s.SendEvent(NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_IMAP_PORT_CHANGE_ERROR))
}
}
func (s *Service) UseSslForImap(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.BoolValue, error) { //nolint:revive,stylecheck if s.bridge.GetSMTPPort() != int(settings.SmtpPort) {
s.log.Debug("UseSslForImap") if err := s.bridge.SetSMTPPort(int(settings.SmtpPort)); err != nil {
s.log.WithError(err).Error("Failed to set SMTP port")
_ = s.SendEvent(NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_SMTP_PORT_CHANGE_ERROR))
}
}
return wrapperspb.Bool(s.bridge.GetIMAPSSL()), nil _ = s.SendEvent(NewMailServerSettingsChangedEvent(&ImapSmtpSettings{
ImapPort: int32(s.bridge.GetIMAPPort()),
SmtpPort: int32(s.bridge.GetSMTPPort()),
UseSSLForImap: s.bridge.GetIMAPSSL(),
UseSSLForSmtp: s.bridge.GetSMTPSSL(),
}))
return &emptypb.Empty{}, nil
} }
func (s *Service) Hostname(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.StringValue, error) { func (s *Service) Hostname(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.StringValue, error) {
@ -665,34 +686,6 @@ func (s *Service) Hostname(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.S
return wrapperspb.String(constants.Host), nil return wrapperspb.String(constants.Host), nil
} }
func (s *Service) ImapPort(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.Int32Value, error) {
s.log.Debug("ImapPort")
return wrapperspb.Int32(int32(s.bridge.GetIMAPPort())), nil
}
func (s *Service) SmtpPort(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.Int32Value, error) { //nolint:revive,stylecheck
s.log.Debug("SmtpPort")
return wrapperspb.Int32(int32(s.bridge.GetSMTPPort())), nil
}
func (s *Service) ChangePorts(ctx context.Context, ports *ChangePortsRequest) (*emptypb.Empty, error) {
s.log.WithField("imapPort", ports.ImapPort).WithField("smtpPort", ports.SmtpPort).Debug("ChangePorts")
if err := s.bridge.SetIMAPPort(int(ports.ImapPort)); err != nil {
s.log.WithError(err).Error("Failed to set IMAP port")
return nil, status.Errorf(codes.Internal, "failed to set IMAP port: %v", err)
}
if err := s.bridge.SetSMTPPort(int(ports.SmtpPort)); err != nil {
s.log.WithError(err).Error("Failed to set SMTP port")
return nil, status.Errorf(codes.Internal, "failed to set SMTP port: %v", err)
}
return &emptypb.Empty{}, s.SendEvent(NewMailSettingsChangePortFinishedEvent())
}
func (s *Service) IsPortFree(ctx context.Context, port *wrapperspb.Int32Value) (*wrapperspb.BoolValue, error) { func (s *Service) IsPortFree(ctx context.Context, port *wrapperspb.Int32Value) (*wrapperspb.BoolValue, error) {
s.log.Debug("IsPortFree") s.log.Debug("IsPortFree")

View File

@ -145,9 +145,19 @@ func (s *Service) StartEventTest() error { //nolint:funlen
NewDiskCachePathChangeFinishedEvent(), NewDiskCachePathChangeFinishedEvent(),
// mail settings // mail settings
NewMailSettingsErrorEvent(MailSettingsErrorType_IMAP_PORT_ISSUE), NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_IMAP_PORT_STARTUP_ERROR),
NewMailSettingsUseSslForSmtpFinishedEvent(), NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_SMTP_PORT_STARTUP_ERROR),
NewMailSettingsChangePortFinishedEvent(), NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_IMAP_PORT_CHANGE_ERROR),
NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_SMTP_PORT_CHANGE_ERROR),
NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_IMAP_CONNECTION_MODE_CHANGE_ERROR),
NewMailServerSettingsErrorEvent(MailServerSettingsErrorType_SMTP_CONNECTION_MODE_CHANGE_ERROR),
NewMailServerSettingsChangedEvent(&ImapSmtpSettings{
ImapPort: 1143,
SmtpPort: 1025,
UseSSLForImap: false,
UseSSLForSmtp: false,
}),
NewChangeMailServerSettingsFinishedEvent(),
// keychain // keychain
NewKeychainChangeKeychainFinishedEvent(), NewKeychainChangeKeychainFinishedEvent(),