mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
feat(GODT-2295): notifications for IMAP login when signed out.
This commit is contained in:
2
go.mod
2
go.mod
@ -5,7 +5,7 @@ go 1.18
|
||||
require (
|
||||
github.com/0xAX/notificator v0.0.0-20220220101646-ee9b8921e557
|
||||
github.com/Masterminds/semver/v3 v3.1.1
|
||||
github.com/ProtonMail/gluon v0.14.2-0.20230201115538-18e0b89693fc
|
||||
github.com/ProtonMail/gluon v0.14.2-0.20230202124956-4fa6b6a0b9b5
|
||||
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
|
||||
github.com/ProtonMail/go-proton-api v0.3.1-0.20230202061850-e2fc4deffe20
|
||||
github.com/ProtonMail/go-rfc5322 v0.11.0
|
||||
|
||||
4
go.sum
4
go.sum
@ -28,8 +28,8 @@ github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf h1:yc9daCCYUefEs
|
||||
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf/go.mod h1:o0ESU9p83twszAU8LBeJKFAAMX14tISa0yk4Oo5TOqo=
|
||||
github.com/ProtonMail/docker-credential-helpers v1.1.0 h1:+kvUIpwWcbtP3WFv5sSvkFn/XLzSqPOB5AAthuk9xPk=
|
||||
github.com/ProtonMail/docker-credential-helpers v1.1.0/go.mod h1:mK0aBveCxhnQ756AmaTfXMZDeULvheYVhF/MWMErN5g=
|
||||
github.com/ProtonMail/gluon v0.14.2-0.20230201115538-18e0b89693fc h1:q7sX422Eu9H97v2sLRPmPFi8yBJtNwQRzVN9DSmBHvc=
|
||||
github.com/ProtonMail/gluon v0.14.2-0.20230201115538-18e0b89693fc/go.mod h1:HYHr7hG7LPWI1S50M8NfHRb1kYi5B+Yu4/N/H+y+JUY=
|
||||
github.com/ProtonMail/gluon v0.14.2-0.20230202124956-4fa6b6a0b9b5 h1:AvU75C80KwKiPcAolL0p26zNdjJvr49qlVjgbqY+VsM=
|
||||
github.com/ProtonMail/gluon v0.14.2-0.20230202124956-4fa6b6a0b9b5/go.mod h1:HYHr7hG7LPWI1S50M8NfHRb1kYi5B+Yu4/N/H+y+JUY=
|
||||
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a h1:D+aZah+k14Gn6kmL7eKxoo/4Dr/lK3ChBcwce2+SQP4=
|
||||
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a/go.mod h1:oTGdE7/DlWIr23G0IKW3OXK9wZ5Hw1GGiaJFccTvZi4=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
|
||||
|
||||
@ -21,6 +21,7 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -497,6 +498,21 @@ func TestBridge_InitGluonDirectory(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestBridge_LoginFailed(t *testing.T) {
|
||||
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, vaultKey []byte) {
|
||||
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, vaultKey, func(bridge *bridge.Bridge, mocks *bridge.Mocks) {
|
||||
failCh, done := chToType[events.Event, events.IMAPLoginFailed](bridge.GetEvents(events.IMAPLoginFailed{}))
|
||||
defer done()
|
||||
|
||||
imapClient, err := client.Dial(net.JoinHostPort(constants.Host, fmt.Sprint(bridge.GetIMAPPort())))
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Error(t, imapClient.Login("badUser", "badPass"))
|
||||
require.Equal(t, "badUser", (<-failCh).Username)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func TestBridge_ChangeCacheDirectory(t *testing.T) {
|
||||
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, vaultKey []byte) {
|
||||
userID, addrID, err := s.CreateUser("imap", password)
|
||||
|
||||
@ -33,6 +33,7 @@ import (
|
||||
"github.com/ProtonMail/gluon/store"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/async"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/constants"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/events"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/logging"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/user"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/vault"
|
||||
@ -228,6 +229,13 @@ func (bridge *Bridge) handleIMAPEvent(event imapEvents.Event) {
|
||||
if event.IMAPID.Name != "" && event.IMAPID.Version != "" {
|
||||
bridge.identifier.SetClient(event.IMAPID.Name, event.IMAPID.Version)
|
||||
}
|
||||
|
||||
case imapEvents.LoginFailed:
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"sessionID": event.SessionID,
|
||||
"username": event.Username,
|
||||
}).Info("Received IMAP login failure notification")
|
||||
bridge.publish(events.IMAPLoginFailed{Username: event.Username})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -169,3 +169,13 @@ type UsedSpaceChanged struct {
|
||||
func (event UsedSpaceChanged) String() string {
|
||||
return fmt.Sprintf("UsedSpaceChanged: UserID: %s, UsedSpace: %v", event.UserID, event.UsedSpace)
|
||||
}
|
||||
|
||||
type IMAPLoginFailed struct {
|
||||
eventBase
|
||||
|
||||
Username string
|
||||
}
|
||||
|
||||
func (event IMAPLoginFailed) String() string {
|
||||
return fmt.Sprintf("IMAPLoginFailed: Username: %s", event.Username)
|
||||
}
|
||||
|
||||
@ -52,6 +52,7 @@ UsersTab::UsersTab(QWidget *parent)
|
||||
connect(ui_.tableUserList, &QTableView::doubleClicked, this, &UsersTab::onEditUserButton);
|
||||
connect(ui_.buttonRemoveUser, &QPushButton::clicked, this, &UsersTab::onRemoveUserButton);
|
||||
connect(ui_.buttonUserBadEvent, &QPushButton::clicked, this, &UsersTab::onSendUserBadEvent);
|
||||
connect(ui_.buttonImapLoginFailed, &QPushButton::clicked, this, &UsersTab::onSendIMAPLoginFailedEvent);
|
||||
connect(ui_.buttonUsedBytesChanged, &QPushButton::clicked, this, &UsersTab::onSendUsedBytesChangedEvent);
|
||||
connect(ui_.checkUsernamePasswordError, &QCheckBox::toggled, this, &UsersTab::updateGUIState);
|
||||
|
||||
@ -189,6 +190,19 @@ void UsersTab::onSendUsedBytesChangedEvent() {
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
void UsersTab::onSendIMAPLoginFailedEvent() {
|
||||
GRPCService &grpc = app().grpc();
|
||||
if (grpc.isStreaming()) {
|
||||
grpc.sendEvent(newIMAPLoginFailedEvent(ui_.editIMAPLoginFailedUsername->text()));
|
||||
}
|
||||
|
||||
this->updateGUIState();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
@ -203,6 +217,9 @@ void UsersTab::updateGUIState() {
|
||||
ui_.groupBoxUsedSpace->setEnabled(hasSelectedUser && (UserState::Connected == state));
|
||||
ui_.editUsernamePasswordError->setEnabled(ui_.checkUsernamePasswordError->isChecked());
|
||||
ui_.spinUsedBytes->setValue(user ? user->usedBytes() : 0.0);
|
||||
|
||||
if (user)
|
||||
ui_.editIMAPLoginFailedUsername->setText(user->primaryEmailOrUsername());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,6 +62,7 @@ private slots:
|
||||
void onSelectionChanged(QItemSelection, QItemSelection); ///< Slot for the change of the selection.
|
||||
void onSendUserBadEvent(); ///< Slot for the 'Send Bad Event Error' button.
|
||||
void onSendUsedBytesChangedEvent(); ///< Slot for the 'Send Used Bytes Changed Event' button.
|
||||
void onSendIMAPLoginFailedEvent(); ///< Slot for the 'Send IMAP Login failure Event' button.
|
||||
void updateGUIState(); ///< Update the GUI state.
|
||||
|
||||
private: // member functions.
|
||||
|
||||
@ -66,52 +66,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxUsedSpace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Used Bytes Changed</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="hBoxUsedBytes" stretch="0,1">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelUsedBytes">
|
||||
<property name="text">
|
||||
<string>Used Bytes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinUsedBytes">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1000000000000000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonUsedBytesChanged">
|
||||
<property name="text">
|
||||
<string>Send Used Bytes Changed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxBadEvent">
|
||||
<property name="minimumSize">
|
||||
@ -126,13 +80,6 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelUserBadEvent">
|
||||
<property name="text">
|
||||
<string>Message: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editUserBadEvent">
|
||||
<property name="minimumSize">
|
||||
@ -142,18 +89,102 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Bad event error.</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>error message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonUserBadEvent">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxUsedSpace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Used Bytes Changed</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonUserBadEvent">
|
||||
<property name="text">
|
||||
<string>Send Bad Event Error</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="hBoxUsedBytes" stretch="1,0">
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinUsedBytes">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1000000000000000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonUsedBytesChanged">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxIMAPLoginFailed">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>IMAP Login Failure</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editIMAPLoginFailedUsername">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>username or primary email</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonImapLoginFailed">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@ -467,6 +467,7 @@ bool QMLBackend::isDoHEnabled() const {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The value for the 'isAutomaticUpdateOn' property.
|
||||
//****************************************************************************************************************************************************
|
||||
@ -876,8 +877,9 @@ void QMLBackend::onUserBadEvent(QString const &userID, QString const &errorMessa
|
||||
HANDLE_EXCEPTION(
|
||||
Q_UNUSED(errorMessage);
|
||||
SPUser const user = users_->getUserWithID(userID);
|
||||
if (!user)
|
||||
if (!user) {
|
||||
app().log().error(QString("Received bad event for unknown user %1").arg(user->id()));
|
||||
}
|
||||
user->setState(UserState::SignedOut);
|
||||
emit userBadEvent(tr("%1 was logged out because of an internal error.").arg(user->primaryEmailOrUsername()));
|
||||
emit selectUser(userID);
|
||||
@ -886,6 +888,24 @@ void QMLBackend::onUserBadEvent(QString const &userID, QString const &errorMessa
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] username The username (or primary email address)
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::onIMAPLoginFailed(QString const &username) {
|
||||
HANDLE_EXCEPTION(
|
||||
SPUser const user = users_->getUserWithUsernameOrEmail(username);
|
||||
if ((!user) || (user->state() != UserState::SignedOut)) { // We want to pop-up only if a signed-out user has been detected
|
||||
return;
|
||||
}
|
||||
if (user->isInIMAPLoginFailureCooldown())
|
||||
return;
|
||||
user->startImapLoginFailureCooldown(60 * 60 * 1000); // 1 hour cooldown during which we will not display this notification to this user again.
|
||||
emit selectUser(user->id());
|
||||
emit imapLoginWhileSignedOut(username);
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
@ -994,5 +1014,7 @@ void QMLBackend::connectGrpcEvents() {
|
||||
// user events
|
||||
connect(client, &GRPCClient::userDisconnected, this, &QMLBackend::userDisconnected);
|
||||
connect(client, &GRPCClient::userBadEvent, this, &QMLBackend::onUserBadEvent);
|
||||
connect(client, &GRPCClient::imapLoginFailed, this, &QMLBackend::onIMAPLoginFailed);
|
||||
|
||||
users_->connectGRPCEvents();
|
||||
}
|
||||
|
||||
@ -180,6 +180,7 @@ public slots: // slot for signals received from gRPC that need transformation in
|
||||
void onLoginFinished(QString const &userID, bool wasSignedOut); ///< Slot for LoginFinished gRPC event.
|
||||
void onLoginAlreadyLoggedIn(QString const &userID); ///< Slot for the LoginAlreadyLoggedIn gRPC event.
|
||||
void onUserBadEvent(QString const& userID, QString const& errorMessage); ///< Slot for the userBadEvent gRPC event.
|
||||
void onIMAPLoginFailed(QString const& username); ///< Slot the the imapLoginFailed event.
|
||||
|
||||
signals: // Signals received from the Go backend, to be forwarded to QML
|
||||
void toggleAutostartFinished(); ///< Signal for the 'toggleAutostartFinished' gRPC stream event.
|
||||
@ -233,6 +234,7 @@ signals: // Signals received from the Go backend, to be forwarded to QML
|
||||
void hideMainWindow(); ///< Signal for the 'hideMainWindow' gRPC stream event.
|
||||
void genericError(QString const &title, QString const &description); ///< Signal for the 'genericError' gRPC stream event.
|
||||
void selectUser(QString const); ///< Signal that request the given user account to be displayed.
|
||||
void imapLoginWhileSignedOut(QString const& username); ///< Signal for the notification of IMAP login attempt on a signed out account.
|
||||
|
||||
// This signal is emitted when an exception is intercepted is calls triggered by QML. QML engine would intercept the exception otherwise.
|
||||
void fatalError(QString const &function, QString const &message) const; ///< Signal emitted when an fatal error occurs.
|
||||
|
||||
@ -149,6 +149,19 @@ bridgepp::SPUser UserList::getUserWithID(QString const &userID) const {
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] username The username or email.
|
||||
/// \return The user with the given ID.
|
||||
/// \return A null pointer if the user could not be found.
|
||||
//****************************************************************************************************************************************************
|
||||
bridgepp::SPUser UserList::getUserWithUsernameOrEmail(QString const &username) const {
|
||||
QList<SPUser>::const_iterator it = std::find_if(users_.begin(), users_.end(), [username](SPUser const &user) -> bool {
|
||||
return user && ((username.compare(user->username(), Qt::CaseInsensitive) == 0) || user->addresses().contains(username, Qt::CaseInsensitive));
|
||||
});
|
||||
return (it == users_.end()) ? nullptr : *it;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] row The row.
|
||||
//****************************************************************************************************************************************************
|
||||
|
||||
@ -44,6 +44,7 @@ public: // member functions.
|
||||
void appendUser(bridgepp::SPUser const &user); ///< Add a new user.
|
||||
void updateUserAtRow(int row, bridgepp::User const &user); ///< Update the user at given row.
|
||||
bridgepp::SPUser getUserWithID(QString const &userID) const; ///< Retrieve the user with the given ID.
|
||||
bridgepp::SPUser getUserWithUsernameOrEmail(QString const& username) const; ///< Retrieve the user with the given primary email address or username
|
||||
|
||||
// the userCount property.
|
||||
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
||||
|
||||
@ -81,6 +81,7 @@ QtObject {
|
||||
root.apiCertIssue,
|
||||
root.noActiveKeyForRecipient,
|
||||
root.userBadEvent,
|
||||
root.imapLoginWhileSignedOut,
|
||||
root.genericError
|
||||
]
|
||||
|
||||
@ -1129,6 +1130,34 @@ QtObject {
|
||||
]
|
||||
}
|
||||
|
||||
property Notification imapLoginWhileSignedOut: Notification {
|
||||
title: qsTr("IMAP Login failed")
|
||||
brief: title
|
||||
description: "#PlaceHolderText"
|
||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
group: Notifications.Group.Connection
|
||||
|
||||
Connections {
|
||||
target: Backend
|
||||
function onImapLoginWhileSignedOut(username) {
|
||||
root.imapLoginWhileSignedOut.description = qsTr("An email client tried to connect to the account %1, but this account is signed " +
|
||||
"out. Please sign-in to continue.").arg(username)
|
||||
root.imapLoginWhileSignedOut.active = true
|
||||
}
|
||||
}
|
||||
|
||||
action: [
|
||||
Action {
|
||||
text: qsTr("OK")
|
||||
|
||||
onTriggered: {
|
||||
root.imapLoginWhileSignedOut.active = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
property Notification genericError: Notification {
|
||||
title: "#PlaceholderText#"
|
||||
description: "#PlaceholderText#"
|
||||
|
||||
@ -588,6 +588,19 @@ SPStreamEvent newUsedBytesChangedEvent(QString const &userID, qint64 usedBytes)
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] username The username that was provided for the failed IMAP login attempt.
|
||||
/// \return The event.
|
||||
//****************************************************************************************************************************************************
|
||||
SPStreamEvent newIMAPLoginFailedEvent(QString const &username) {
|
||||
auto event = new grpc::ImapLoginFailedEvent;
|
||||
event->set_username(username.toStdString());
|
||||
auto userEvent = new grpc::UserEvent;
|
||||
userEvent->set_allocated_imaploginfailedevent(event);
|
||||
return wrapUserEvent(userEvent);
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] errorCode The error errorCode.
|
||||
/// \return The event.
|
||||
|
||||
@ -79,6 +79,7 @@ SPStreamEvent newUserDisconnectedEvent(QString const &username); ///< Create a n
|
||||
SPStreamEvent newUserChangedEvent(QString const &userID); ///< Create a new UserChangedEvent event.
|
||||
SPStreamEvent newUserBadEvent(QString const &userID, QString const& errorMessage); ///< Create a new UserBadEvent event.
|
||||
SPStreamEvent newUsedBytesChangedEvent(QString const &userID, qint64 usedBytes); ///< Create a new UsedBytesChangedEvent event.
|
||||
SPStreamEvent newIMAPLoginFailedEvent(QString const &username); ///< Create a new ImapLoginFailedEvent event.
|
||||
|
||||
// Generic error event
|
||||
SPStreamEvent newGenericErrorEvent(grpc::ErrorCode errorCode); ///< Create a new GenericErrrorEvent event.
|
||||
|
||||
@ -1382,6 +1382,13 @@ void GRPCClient::processUserEvent(UserEvent const &event) {
|
||||
emit usedBytesChanged(userID, usedBytes);
|
||||
break;
|
||||
}
|
||||
case UserEvent::kImapLoginFailedEvent: {
|
||||
ImapLoginFailedEvent const& e = event.imaploginfailedevent();
|
||||
QString const username = QString::fromStdString(e.username());
|
||||
this->logTrace(QString("User event received: IMAPLoginFailed (username = %1).:").arg(username));
|
||||
emit imapLoginFailed(username);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
this->logError("Unknown User event received.");
|
||||
}
|
||||
|
||||
@ -180,6 +180,7 @@ signals:
|
||||
void userChanged(QString const &userID);
|
||||
void userBadEvent(QString const &userID, QString const& errorMessage);
|
||||
void usedBytesChanged(QString const &userID, qint64 usedBytes);
|
||||
void imapLoginFailed(QString const& username);
|
||||
|
||||
public: // keychain related calls
|
||||
grpc::Status availableKeychains(QStringList &outKeychains);
|
||||
|
||||
@ -773,6 +773,19 @@ struct UsedBytesChangedEventDefaultTypeInternal {
|
||||
};
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UsedBytesChangedEventDefaultTypeInternal _UsedBytesChangedEvent_default_instance_;
|
||||
PROTOBUF_CONSTEXPR ImapLoginFailedEvent::ImapLoginFailedEvent(
|
||||
::_pbi::ConstantInitialized): _impl_{
|
||||
/*decltype(_impl_.username_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
|
||||
, /*decltype(_impl_._cached_size_)*/{}} {}
|
||||
struct ImapLoginFailedEventDefaultTypeInternal {
|
||||
PROTOBUF_CONSTEXPR ImapLoginFailedEventDefaultTypeInternal()
|
||||
: _instance(::_pbi::ConstantInitialized{}) {}
|
||||
~ImapLoginFailedEventDefaultTypeInternal() {}
|
||||
union {
|
||||
ImapLoginFailedEvent _instance;
|
||||
};
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ImapLoginFailedEventDefaultTypeInternal _ImapLoginFailedEvent_default_instance_;
|
||||
PROTOBUF_CONSTEXPR GenericErrorEvent::GenericErrorEvent(
|
||||
::_pbi::ConstantInitialized): _impl_{
|
||||
/*decltype(_impl_.code_)*/0
|
||||
@ -787,7 +800,7 @@ struct GenericErrorEventDefaultTypeInternal {
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GenericErrorEventDefaultTypeInternal _GenericErrorEvent_default_instance_;
|
||||
} // namespace grpc
|
||||
static ::_pb::Metadata file_level_metadata_bridge_2eproto[59];
|
||||
static ::_pb::Metadata file_level_metadata_bridge_2eproto[60];
|
||||
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_bridge_2eproto[7];
|
||||
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_bridge_2eproto = nullptr;
|
||||
|
||||
@ -1214,6 +1227,7 @@ const uint32_t TableStruct_bridge_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(p
|
||||
::_pbi::kInvalidFieldOffsetTag,
|
||||
::_pbi::kInvalidFieldOffsetTag,
|
||||
::_pbi::kInvalidFieldOffsetTag,
|
||||
::_pbi::kInvalidFieldOffsetTag,
|
||||
PROTOBUF_FIELD_OFFSET(::grpc::UserEvent, _impl_.event_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::grpc::ToggleSplitModeFinishedEvent, _internal_metadata_),
|
||||
@ -1253,6 +1267,13 @@ const uint32_t TableStruct_bridge_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(p
|
||||
PROTOBUF_FIELD_OFFSET(::grpc::UsedBytesChangedEvent, _impl_.userid_),
|
||||
PROTOBUF_FIELD_OFFSET(::grpc::UsedBytesChangedEvent, _impl_.usedbytes_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::grpc::ImapLoginFailedEvent, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
~0u, // no _oneof_case_
|
||||
~0u, // no _weak_field_map_
|
||||
~0u, // no _inlined_string_donated_
|
||||
PROTOBUF_FIELD_OFFSET(::grpc::ImapLoginFailedEvent, _impl_.username_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::grpc::GenericErrorEvent, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
~0u, // no _oneof_case_
|
||||
@ -1314,12 +1335,13 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
|
||||
{ 398, -1, -1, sizeof(::grpc::AddressChangedLogoutEvent)},
|
||||
{ 405, -1, -1, sizeof(::grpc::ApiCertIssueEvent)},
|
||||
{ 411, -1, -1, sizeof(::grpc::UserEvent)},
|
||||
{ 423, -1, -1, sizeof(::grpc::ToggleSplitModeFinishedEvent)},
|
||||
{ 430, -1, -1, sizeof(::grpc::UserDisconnectedEvent)},
|
||||
{ 437, -1, -1, sizeof(::grpc::UserChangedEvent)},
|
||||
{ 444, -1, -1, sizeof(::grpc::UserBadEvent)},
|
||||
{ 452, -1, -1, sizeof(::grpc::UsedBytesChangedEvent)},
|
||||
{ 460, -1, -1, sizeof(::grpc::GenericErrorEvent)},
|
||||
{ 424, -1, -1, sizeof(::grpc::ToggleSplitModeFinishedEvent)},
|
||||
{ 431, -1, -1, sizeof(::grpc::UserDisconnectedEvent)},
|
||||
{ 438, -1, -1, sizeof(::grpc::UserChangedEvent)},
|
||||
{ 445, -1, -1, sizeof(::grpc::UserBadEvent)},
|
||||
{ 453, -1, -1, sizeof(::grpc::UsedBytesChangedEvent)},
|
||||
{ 461, -1, -1, sizeof(::grpc::ImapLoginFailedEvent)},
|
||||
{ 468, -1, -1, sizeof(::grpc::GenericErrorEvent)},
|
||||
};
|
||||
|
||||
static const ::_pb::Message* const file_default_instances[] = {
|
||||
@ -1381,6 +1403,7 @@ static const ::_pb::Message* const file_default_instances[] = {
|
||||
&::grpc::_UserChangedEvent_default_instance_._instance,
|
||||
&::grpc::_UserBadEvent_default_instance_._instance,
|
||||
&::grpc::_UsedBytesChangedEvent_default_instance_._instance,
|
||||
&::grpc::_ImapLoginFailedEvent_default_instance_._instance,
|
||||
&::grpc::_GenericErrorEvent_default_instance_._instance,
|
||||
};
|
||||
|
||||
@ -1502,138 +1525,141 @@ const char descriptor_table_protodef_bridge_2eproto[] PROTOBUF_SECTION_VARIABLE(
|
||||
"KeyForRecipientEvent\022\r\n\005email\030\001 \001(\t\"&\n\023A"
|
||||
"ddressChangedEvent\022\017\n\007address\030\001 \001(\t\",\n\031A"
|
||||
"ddressChangedLogoutEvent\022\017\n\007address\030\001 \001("
|
||||
"\t\"\023\n\021ApiCertIssueEvent\"\255\002\n\tUserEvent\022E\n\027"
|
||||
"\t\"\023\n\021ApiCertIssueEvent\"\351\002\n\tUserEvent\022E\n\027"
|
||||
"toggleSplitModeFinished\030\001 \001(\0132\".grpc.Tog"
|
||||
"gleSplitModeFinishedEventH\000\0227\n\020userDisco"
|
||||
"nnected\030\002 \001(\0132\033.grpc.UserDisconnectedEve"
|
||||
"ntH\000\022-\n\013userChanged\030\003 \001(\0132\026.grpc.UserCha"
|
||||
"ngedEventH\000\022*\n\014userBadEvent\030\004 \001(\0132\022.grpc"
|
||||
".UserBadEventH\000\022<\n\025usedBytesChangedEvent"
|
||||
"\030\005 \001(\0132\033.grpc.UsedBytesChangedEventH\000B\007\n"
|
||||
"\005event\".\n\034ToggleSplitModeFinishedEvent\022\016"
|
||||
"\n\006userID\030\001 \001(\t\")\n\025UserDisconnectedEvent\022"
|
||||
"\020\n\010username\030\001 \001(\t\"\"\n\020UserChangedEvent\022\016\n"
|
||||
"\006userID\030\001 \001(\t\"4\n\014UserBadEvent\022\016\n\006userID\030"
|
||||
"\001 \001(\t\022\024\n\014errorMessage\030\002 \001(\t\":\n\025UsedBytes"
|
||||
"ChangedEvent\022\016\n\006userID\030\001 \001(\t\022\021\n\tusedByte"
|
||||
"s\030\002 \001(\003\"2\n\021GenericErrorEvent\022\035\n\004code\030\001 \001"
|
||||
"(\0162\017.grpc.ErrorCode*q\n\010LogLevel\022\r\n\tLOG_P"
|
||||
"ANIC\020\000\022\r\n\tLOG_FATAL\020\001\022\r\n\tLOG_ERROR\020\002\022\014\n\010"
|
||||
"LOG_WARN\020\003\022\014\n\010LOG_INFO\020\004\022\r\n\tLOG_DEBUG\020\005\022"
|
||||
"\r\n\tLOG_TRACE\020\006*6\n\tUserState\022\016\n\nSIGNED_OU"
|
||||
"T\020\000\022\n\n\006LOCKED\020\001\022\r\n\tCONNECTED\020\002*\242\001\n\016Login"
|
||||
"ErrorType\022\033\n\027USERNAME_PASSWORD_ERROR\020\000\022\r"
|
||||
"\n\tFREE_USER\020\001\022\024\n\020CONNECTION_ERROR\020\002\022\r\n\tT"
|
||||
"FA_ERROR\020\003\022\r\n\tTFA_ABORT\020\004\022\027\n\023TWO_PASSWOR"
|
||||
"DS_ERROR\020\005\022\027\n\023TWO_PASSWORDS_ABORT\020\006*[\n\017U"
|
||||
"pdateErrorType\022\027\n\023UPDATE_MANUAL_ERROR\020\000\022"
|
||||
"\026\n\022UPDATE_FORCE_ERROR\020\001\022\027\n\023UPDATE_SILENT"
|
||||
"_ERROR\020\002*k\n\022DiskCacheErrorType\022 \n\034DISK_C"
|
||||
"ACHE_UNAVAILABLE_ERROR\020\000\022\036\n\032CANT_MOVE_DI"
|
||||
"SK_CACHE_ERROR\020\001\022\023\n\017DISK_FULL_ERROR\020\002*\335\001"
|
||||
"\n\033MailServerSettingsErrorType\022\033\n\027IMAP_PO"
|
||||
"RT_STARTUP_ERROR\020\000\022\033\n\027SMTP_PORT_STARTUP_"
|
||||
"ERROR\020\001\022\032\n\026IMAP_PORT_CHANGE_ERROR\020\002\022\032\n\026S"
|
||||
"MTP_PORT_CHANGE_ERROR\020\003\022%\n!IMAP_CONNECTI"
|
||||
"ON_MODE_CHANGE_ERROR\020\004\022%\n!SMTP_CONNECTIO"
|
||||
"N_MODE_CHANGE_ERROR\020\005*S\n\tErrorCode\022\021\n\rUN"
|
||||
"KNOWN_ERROR\020\000\022\031\n\025TLS_CERT_EXPORT_ERROR\020\001"
|
||||
"\022\030\n\024TLS_KEY_EXPORT_ERROR\020\0022\231\035\n\006Bridge\022I\n"
|
||||
"\013CheckTokens\022\034.google.protobuf.StringVal"
|
||||
"ue\032\034.google.protobuf.StringValue\022\?\n\013AddL"
|
||||
"ogEntry\022\030.grpc.AddLogEntryRequest\032\026.goog"
|
||||
"le.protobuf.Empty\022:\n\010GuiReady\022\026.google.p"
|
||||
"rotobuf.Empty\032\026.grpc.GuiReadyResponse\0226\n"
|
||||
"\004Quit\022\026.google.protobuf.Empty\032\026.google.p"
|
||||
"rotobuf.Empty\0229\n\007Restart\022\026.google.protob"
|
||||
"uf.Empty\032\026.google.protobuf.Empty\022C\n\rShow"
|
||||
"OnStartup\022\026.google.protobuf.Empty\032\032.goog"
|
||||
"le.protobuf.BoolValue\022F\n\020SetIsAutostartO"
|
||||
"n\022\032.google.protobuf.BoolValue\032\026.google.p"
|
||||
"rotobuf.Empty\022C\n\rIsAutostartOn\022\026.google."
|
||||
"protobuf.Empty\032\032.google.protobuf.BoolVal"
|
||||
"ue\022F\n\020SetIsBetaEnabled\022\032.google.protobuf"
|
||||
".BoolValue\032\026.google.protobuf.Empty\022C\n\rIs"
|
||||
"BetaEnabled\022\026.google.protobuf.Empty\032\032.go"
|
||||
"ogle.protobuf.BoolValue\022I\n\023SetIsAllMailV"
|
||||
"isible\022\032.google.protobuf.BoolValue\032\026.goo"
|
||||
"gle.protobuf.Empty\022F\n\020IsAllMailVisible\022\026"
|
||||
".google.protobuf.Empty\032\032.google.protobuf"
|
||||
".BoolValue\022<\n\004GoOs\022\026.google.protobuf.Emp"
|
||||
"ty\032\034.google.protobuf.StringValue\022>\n\014Trig"
|
||||
"gerReset\022\026.google.protobuf.Empty\032\026.googl"
|
||||
"e.protobuf.Empty\022\?\n\007Version\022\026.google.pro"
|
||||
"tobuf.Empty\032\034.google.protobuf.StringValu"
|
||||
"e\022@\n\010LogsPath\022\026.google.protobuf.Empty\032\034."
|
||||
"google.protobuf.StringValue\022C\n\013LicensePa"
|
||||
"th\022\026.google.protobuf.Empty\032\034.google.prot"
|
||||
"obuf.StringValue\022L\n\024ReleaseNotesPageLink"
|
||||
"\030\005 \001(\0132\033.grpc.UsedBytesChangedEventH\000\022:\n"
|
||||
"\024imapLoginFailedEvent\030\006 \001(\0132\032.grpc.ImapL"
|
||||
"oginFailedEventH\000B\007\n\005event\".\n\034ToggleSpli"
|
||||
"tModeFinishedEvent\022\016\n\006userID\030\001 \001(\t\")\n\025Us"
|
||||
"erDisconnectedEvent\022\020\n\010username\030\001 \001(\t\"\"\n"
|
||||
"\020UserChangedEvent\022\016\n\006userID\030\001 \001(\t\"4\n\014Use"
|
||||
"rBadEvent\022\016\n\006userID\030\001 \001(\t\022\024\n\014errorMessag"
|
||||
"e\030\002 \001(\t\":\n\025UsedBytesChangedEvent\022\016\n\006user"
|
||||
"ID\030\001 \001(\t\022\021\n\tusedBytes\030\002 \001(\003\"(\n\024ImapLogin"
|
||||
"FailedEvent\022\020\n\010username\030\001 \001(\t\"2\n\021Generic"
|
||||
"ErrorEvent\022\035\n\004code\030\001 \001(\0162\017.grpc.ErrorCod"
|
||||
"e*q\n\010LogLevel\022\r\n\tLOG_PANIC\020\000\022\r\n\tLOG_FATA"
|
||||
"L\020\001\022\r\n\tLOG_ERROR\020\002\022\014\n\010LOG_WARN\020\003\022\014\n\010LOG_"
|
||||
"INFO\020\004\022\r\n\tLOG_DEBUG\020\005\022\r\n\tLOG_TRACE\020\006*6\n\t"
|
||||
"UserState\022\016\n\nSIGNED_OUT\020\000\022\n\n\006LOCKED\020\001\022\r\n"
|
||||
"\tCONNECTED\020\002*\242\001\n\016LoginErrorType\022\033\n\027USERN"
|
||||
"AME_PASSWORD_ERROR\020\000\022\r\n\tFREE_USER\020\001\022\024\n\020C"
|
||||
"ONNECTION_ERROR\020\002\022\r\n\tTFA_ERROR\020\003\022\r\n\tTFA_"
|
||||
"ABORT\020\004\022\027\n\023TWO_PASSWORDS_ERROR\020\005\022\027\n\023TWO_"
|
||||
"PASSWORDS_ABORT\020\006*[\n\017UpdateErrorType\022\027\n\023"
|
||||
"UPDATE_MANUAL_ERROR\020\000\022\026\n\022UPDATE_FORCE_ER"
|
||||
"ROR\020\001\022\027\n\023UPDATE_SILENT_ERROR\020\002*k\n\022DiskCa"
|
||||
"cheErrorType\022 \n\034DISK_CACHE_UNAVAILABLE_E"
|
||||
"RROR\020\000\022\036\n\032CANT_MOVE_DISK_CACHE_ERROR\020\001\022\023"
|
||||
"\n\017DISK_FULL_ERROR\020\002*\335\001\n\033MailServerSettin"
|
||||
"gsErrorType\022\033\n\027IMAP_PORT_STARTUP_ERROR\020\000"
|
||||
"\022\033\n\027SMTP_PORT_STARTUP_ERROR\020\001\022\032\n\026IMAP_PO"
|
||||
"RT_CHANGE_ERROR\020\002\022\032\n\026SMTP_PORT_CHANGE_ER"
|
||||
"ROR\020\003\022%\n!IMAP_CONNECTION_MODE_CHANGE_ERR"
|
||||
"OR\020\004\022%\n!SMTP_CONNECTION_MODE_CHANGE_ERRO"
|
||||
"R\020\005*S\n\tErrorCode\022\021\n\rUNKNOWN_ERROR\020\000\022\031\n\025T"
|
||||
"LS_CERT_EXPORT_ERROR\020\001\022\030\n\024TLS_KEY_EXPORT"
|
||||
"_ERROR\020\0022\231\035\n\006Bridge\022I\n\013CheckTokens\022\034.goo"
|
||||
"gle.protobuf.StringValue\032\034.google.protob"
|
||||
"uf.StringValue\022\?\n\013AddLogEntry\022\030.grpc.Add"
|
||||
"LogEntryRequest\032\026.google.protobuf.Empty\022"
|
||||
":\n\010GuiReady\022\026.google.protobuf.Empty\032\026.gr"
|
||||
"pc.GuiReadyResponse\0226\n\004Quit\022\026.google.pro"
|
||||
"tobuf.Empty\032\026.google.protobuf.Empty\0229\n\007R"
|
||||
"estart\022\026.google.protobuf.Empty\032\026.google."
|
||||
"protobuf.Empty\022C\n\rShowOnStartup\022\026.google"
|
||||
".protobuf.Empty\032\032.google.protobuf.BoolVa"
|
||||
"lue\022F\n\020SetIsAutostartOn\022\032.google.protobu"
|
||||
"f.BoolValue\032\026.google.protobuf.Empty\022C\n\rI"
|
||||
"sAutostartOn\022\026.google.protobuf.Empty\032\032.g"
|
||||
"oogle.protobuf.BoolValue\022F\n\020SetIsBetaEna"
|
||||
"bled\022\032.google.protobuf.BoolValue\032\026.googl"
|
||||
"e.protobuf.Empty\022C\n\rIsBetaEnabled\022\026.goog"
|
||||
"le.protobuf.Empty\032\032.google.protobuf.Bool"
|
||||
"Value\022I\n\023SetIsAllMailVisible\022\032.google.pr"
|
||||
"otobuf.BoolValue\032\026.google.protobuf.Empty"
|
||||
"\022F\n\020IsAllMailVisible\022\026.google.protobuf.E"
|
||||
"mpty\032\032.google.protobuf.BoolValue\022<\n\004GoOs"
|
||||
"\022\026.google.protobuf.Empty\032\034.google.protob"
|
||||
"uf.StringValue\022N\n\026DependencyLicensesLink"
|
||||
"uf.StringValue\022>\n\014TriggerReset\022\026.google."
|
||||
"protobuf.Empty\032\026.google.protobuf.Empty\022\?"
|
||||
"\n\007Version\022\026.google.protobuf.Empty\032\034.goog"
|
||||
"le.protobuf.StringValue\022@\n\010LogsPath\022\026.go"
|
||||
"ogle.protobuf.Empty\032\034.google.protobuf.St"
|
||||
"ringValue\022C\n\013LicensePath\022\026.google.protob"
|
||||
"uf.Empty\032\034.google.protobuf.StringValue\022L"
|
||||
"\n\024ReleaseNotesPageLink\022\026.google.protobuf"
|
||||
".Empty\032\034.google.protobuf.StringValue\022N\n\026"
|
||||
"DependencyLicensesLink\022\026.google.protobuf"
|
||||
".Empty\032\034.google.protobuf.StringValue\022G\n\017"
|
||||
"LandingPageLink\022\026.google.protobuf.Empty\032"
|
||||
"\034.google.protobuf.StringValue\022J\n\022SetColo"
|
||||
"rSchemeName\022\034.google.protobuf.StringValu"
|
||||
"e\032\026.google.protobuf.Empty\022G\n\017ColorScheme"
|
||||
"Name\022\026.google.protobuf.Empty\032\034.google.pr"
|
||||
"otobuf.StringValue\022J\n\022CurrentEmailClient"
|
||||
"\022\026.google.protobuf.Empty\032\034.google.protob"
|
||||
"uf.StringValue\022G\n\017LandingPageLink\022\026.goog"
|
||||
"uf.StringValue\022;\n\tReportBug\022\026.grpc.Repor"
|
||||
"tBugRequest\032\026.google.protobuf.Empty\022M\n\025E"
|
||||
"xportTLSCertificates\022\034.google.protobuf.S"
|
||||
"tringValue\032\026.google.protobuf.Empty\022E\n\rFo"
|
||||
"rceLauncher\022\034.google.protobuf.StringValu"
|
||||
"e\032\026.google.protobuf.Empty\022I\n\021SetMainExec"
|
||||
"utable\022\034.google.protobuf.StringValue\032\026.g"
|
||||
"oogle.protobuf.Empty\0223\n\005Login\022\022.grpc.Log"
|
||||
"inRequest\032\026.google.protobuf.Empty\0226\n\010Log"
|
||||
"in2FA\022\022.grpc.LoginRequest\032\026.google.proto"
|
||||
"buf.Empty\022=\n\017Login2Passwords\022\022.grpc.Logi"
|
||||
"nRequest\032\026.google.protobuf.Empty\022=\n\nLogi"
|
||||
"nAbort\022\027.grpc.LoginAbortRequest\032\026.google"
|
||||
".protobuf.Empty\022=\n\013CheckUpdate\022\026.google."
|
||||
"protobuf.Empty\032\026.google.protobuf.Empty\022\?"
|
||||
"\n\rInstallUpdate\022\026.google.protobuf.Empty\032"
|
||||
"\026.google.protobuf.Empty\022L\n\026SetIsAutomati"
|
||||
"cUpdateOn\022\032.google.protobuf.BoolValue\032\026."
|
||||
"google.protobuf.Empty\022I\n\023IsAutomaticUpda"
|
||||
"teOn\022\026.google.protobuf.Empty\032\032.google.pr"
|
||||
"otobuf.BoolValue\022E\n\rDiskCachePath\022\026.goog"
|
||||
"le.protobuf.Empty\032\034.google.protobuf.Stri"
|
||||
"ngValue\022J\n\022SetColorSchemeName\022\034.google.p"
|
||||
"rotobuf.StringValue\032\026.google.protobuf.Em"
|
||||
"pty\022G\n\017ColorSchemeName\022\026.google.protobuf"
|
||||
".Empty\032\034.google.protobuf.StringValue\022J\n\022"
|
||||
"CurrentEmailClient\022\026.google.protobuf.Emp"
|
||||
"ty\032\034.google.protobuf.StringValue\022;\n\tRepo"
|
||||
"rtBug\022\026.grpc.ReportBugRequest\032\026.google.p"
|
||||
"rotobuf.Empty\022M\n\025ExportTLSCertificates\022\034"
|
||||
".google.protobuf.StringValue\032\026.google.pr"
|
||||
"otobuf.Empty\022E\n\rForceLauncher\022\034.google.p"
|
||||
"rotobuf.StringValue\032\026.google.protobuf.Em"
|
||||
"pty\022I\n\021SetMainExecutable\022\034.google.protob"
|
||||
"uf.StringValue\032\026.google.protobuf.Empty\0223"
|
||||
"\n\005Login\022\022.grpc.LoginRequest\032\026.google.pro"
|
||||
"tobuf.Empty\0226\n\010Login2FA\022\022.grpc.LoginRequ"
|
||||
"est\032\026.google.protobuf.Empty\022=\n\017Login2Pas"
|
||||
"swords\022\022.grpc.LoginRequest\032\026.google.prot"
|
||||
"obuf.Empty\022=\n\nLoginAbort\022\027.grpc.LoginAbo"
|
||||
"rtRequest\032\026.google.protobuf.Empty\022=\n\013Che"
|
||||
"ckUpdate\022\026.google.protobuf.Empty\032\026.googl"
|
||||
"e.protobuf.Empty\022\?\n\rInstallUpdate\022\026.goog"
|
||||
"le.protobuf.Empty\032\026.google.protobuf.Empt"
|
||||
"y\022L\n\026SetIsAutomaticUpdateOn\022\032.google.pro"
|
||||
"tobuf.BoolValue\032\026.google.protobuf.Empty\022"
|
||||
"I\n\023IsAutomaticUpdateOn\022\026.google.protobuf"
|
||||
".Empty\032\032.google.protobuf.BoolValue\022E\n\rDi"
|
||||
"skCachePath\022\026.google.protobuf.Empty\032\034.go"
|
||||
"ogle.protobuf.StringValue\022H\n\020SetDiskCach"
|
||||
"ePath\022\034.google.protobuf.StringValue\032\026.go"
|
||||
"ogle.protobuf.Empty\022E\n\017SetIsDoHEnabled\022\032"
|
||||
".google.protobuf.BoolValue\032\026.google.prot"
|
||||
"obuf.Empty\022B\n\014IsDoHEnabled\022\026.google.prot"
|
||||
"obuf.Empty\032\032.google.protobuf.BoolValue\022D"
|
||||
"\n\022MailServerSettings\022\026.google.protobuf.E"
|
||||
"mpty\032\026.grpc.ImapSmtpSettings\022G\n\025SetMailS"
|
||||
"erverSettings\022\026.grpc.ImapSmtpSettings\032\026."
|
||||
"google.protobuf.Empty\022@\n\010Hostname\022\026.goog"
|
||||
"le.protobuf.Empty\032\034.google.protobuf.Stri"
|
||||
"ngValue\022E\n\nIsPortFree\022\033.google.protobuf."
|
||||
"Int32Value\032\032.google.protobuf.BoolValue\022N"
|
||||
"\n\022AvailableKeychains\022\026.google.protobuf.E"
|
||||
"mpty\032 .grpc.AvailableKeychainsResponse\022J"
|
||||
"\n\022SetCurrentKeychain\022\034.google.protobuf.S"
|
||||
"tringValue\032\026.google.protobuf.Empty\022G\n\017Cu"
|
||||
"rrentKeychain\022\026.google.protobuf.Empty\032\034."
|
||||
"google.protobuf.StringValue\022=\n\013GetUserLi"
|
||||
"st\022\026.google.protobuf.Empty\032\026.grpc.UserLi"
|
||||
"stResponse\0223\n\007GetUser\022\034.google.protobuf."
|
||||
"StringValue\032\n.grpc.User\022F\n\020SetUserSplitM"
|
||||
"ode\022\032.grpc.UserSplitModeRequest\032\026.google"
|
||||
".protobuf.Empty\022B\n\nLogoutUser\022\034.google.p"
|
||||
"rotobuf.StringValue\032\026.google.protobuf.Em"
|
||||
"pty\022B\n\nRemoveUser\022\034.google.protobuf.Stri"
|
||||
"ngValue\032\026.google.protobuf.Empty\022Q\n\026Confi"
|
||||
"gureUserAppleMail\022\037.grpc.ConfigureAppleM"
|
||||
"ailRequest\032\026.google.protobuf.Empty\022\?\n\016Ru"
|
||||
"nEventStream\022\030.grpc.EventStreamRequest\032\021"
|
||||
".grpc.StreamEvent0\001\022A\n\017StopEventStream\022\026"
|
||||
".google.protobuf.Empty\032\026.google.protobuf"
|
||||
".EmptyB6Z4github.com/ProtonMail/proton-b"
|
||||
"ridge/v3/internal/grpcb\006proto3"
|
||||
"ngValue\022H\n\020SetDiskCachePath\022\034.google.pro"
|
||||
"tobuf.StringValue\032\026.google.protobuf.Empt"
|
||||
"y\022E\n\017SetIsDoHEnabled\022\032.google.protobuf.B"
|
||||
"oolValue\032\026.google.protobuf.Empty\022B\n\014IsDo"
|
||||
"HEnabled\022\026.google.protobuf.Empty\032\032.googl"
|
||||
"e.protobuf.BoolValue\022D\n\022MailServerSettin"
|
||||
"gs\022\026.google.protobuf.Empty\032\026.grpc.ImapSm"
|
||||
"tpSettings\022G\n\025SetMailServerSettings\022\026.gr"
|
||||
"pc.ImapSmtpSettings\032\026.google.protobuf.Em"
|
||||
"pty\022@\n\010Hostname\022\026.google.protobuf.Empty\032"
|
||||
"\034.google.protobuf.StringValue\022E\n\nIsPortF"
|
||||
"ree\022\033.google.protobuf.Int32Value\032\032.googl"
|
||||
"e.protobuf.BoolValue\022N\n\022AvailableKeychai"
|
||||
"ns\022\026.google.protobuf.Empty\032 .grpc.Availa"
|
||||
"bleKeychainsResponse\022J\n\022SetCurrentKeycha"
|
||||
"in\022\034.google.protobuf.StringValue\032\026.googl"
|
||||
"e.protobuf.Empty\022G\n\017CurrentKeychain\022\026.go"
|
||||
"ogle.protobuf.Empty\032\034.google.protobuf.St"
|
||||
"ringValue\022=\n\013GetUserList\022\026.google.protob"
|
||||
"uf.Empty\032\026.grpc.UserListResponse\0223\n\007GetU"
|
||||
"ser\022\034.google.protobuf.StringValue\032\n.grpc"
|
||||
".User\022F\n\020SetUserSplitMode\022\032.grpc.UserSpl"
|
||||
"itModeRequest\032\026.google.protobuf.Empty\022B\n"
|
||||
"\nLogoutUser\022\034.google.protobuf.StringValu"
|
||||
"e\032\026.google.protobuf.Empty\022B\n\nRemoveUser\022"
|
||||
"\034.google.protobuf.StringValue\032\026.google.p"
|
||||
"rotobuf.Empty\022Q\n\026ConfigureUserAppleMail\022"
|
||||
"\037.grpc.ConfigureAppleMailRequest\032\026.googl"
|
||||
"e.protobuf.Empty\022\?\n\016RunEventStream\022\030.grp"
|
||||
"c.EventStreamRequest\032\021.grpc.StreamEvent0"
|
||||
"\001\022A\n\017StopEventStream\022\026.google.protobuf.E"
|
||||
"mpty\032\026.google.protobuf.EmptyB6Z4github.c"
|
||||
"om/ProtonMail/proton-bridge/v3/internal/"
|
||||
"grpcb\006proto3"
|
||||
;
|
||||
static const ::_pbi::DescriptorTable* const descriptor_table_bridge_2eproto_deps[2] = {
|
||||
&::descriptor_table_google_2fprotobuf_2fempty_2eproto,
|
||||
@ -1641,9 +1667,9 @@ static const ::_pbi::DescriptorTable* const descriptor_table_bridge_2eproto_deps
|
||||
};
|
||||
static ::_pbi::once_flag descriptor_table_bridge_2eproto_once;
|
||||
const ::_pbi::DescriptorTable descriptor_table_bridge_2eproto = {
|
||||
false, false, 9950, descriptor_table_protodef_bridge_2eproto,
|
||||
false, false, 10052, descriptor_table_protodef_bridge_2eproto,
|
||||
"bridge.proto",
|
||||
&descriptor_table_bridge_2eproto_once, descriptor_table_bridge_2eproto_deps, 2, 59,
|
||||
&descriptor_table_bridge_2eproto_once, descriptor_table_bridge_2eproto_deps, 2, 60,
|
||||
schemas, file_default_instances, TableStruct_bridge_2eproto::offsets,
|
||||
file_level_metadata_bridge_2eproto, file_level_enum_descriptors_bridge_2eproto,
|
||||
file_level_service_descriptors_bridge_2eproto,
|
||||
@ -12407,6 +12433,7 @@ class UserEvent::_Internal {
|
||||
static const ::grpc::UserChangedEvent& userchanged(const UserEvent* msg);
|
||||
static const ::grpc::UserBadEvent& userbadevent(const UserEvent* msg);
|
||||
static const ::grpc::UsedBytesChangedEvent& usedbyteschangedevent(const UserEvent* msg);
|
||||
static const ::grpc::ImapLoginFailedEvent& imaploginfailedevent(const UserEvent* msg);
|
||||
};
|
||||
|
||||
const ::grpc::ToggleSplitModeFinishedEvent&
|
||||
@ -12429,6 +12456,10 @@ const ::grpc::UsedBytesChangedEvent&
|
||||
UserEvent::_Internal::usedbyteschangedevent(const UserEvent* msg) {
|
||||
return *msg->_impl_.event_.usedbyteschangedevent_;
|
||||
}
|
||||
const ::grpc::ImapLoginFailedEvent&
|
||||
UserEvent::_Internal::imaploginfailedevent(const UserEvent* msg) {
|
||||
return *msg->_impl_.event_.imaploginfailedevent_;
|
||||
}
|
||||
void UserEvent::set_allocated_togglesplitmodefinished(::grpc::ToggleSplitModeFinishedEvent* togglesplitmodefinished) {
|
||||
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
|
||||
clear_event();
|
||||
@ -12504,6 +12535,21 @@ void UserEvent::set_allocated_usedbyteschangedevent(::grpc::UsedBytesChangedEven
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:grpc.UserEvent.usedBytesChangedEvent)
|
||||
}
|
||||
void UserEvent::set_allocated_imaploginfailedevent(::grpc::ImapLoginFailedEvent* imaploginfailedevent) {
|
||||
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
|
||||
clear_event();
|
||||
if (imaploginfailedevent) {
|
||||
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
|
||||
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(imaploginfailedevent);
|
||||
if (message_arena != submessage_arena) {
|
||||
imaploginfailedevent = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
|
||||
message_arena, imaploginfailedevent, submessage_arena);
|
||||
}
|
||||
set_has_imaploginfailedevent();
|
||||
_impl_.event_.imaploginfailedevent_ = imaploginfailedevent;
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:grpc.UserEvent.imapLoginFailedEvent)
|
||||
}
|
||||
UserEvent::UserEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
|
||||
@ -12546,6 +12592,11 @@ UserEvent::UserEvent(const UserEvent& from)
|
||||
from._internal_usedbyteschangedevent());
|
||||
break;
|
||||
}
|
||||
case kImapLoginFailedEvent: {
|
||||
_this->_internal_mutable_imaploginfailedevent()->::grpc::ImapLoginFailedEvent::MergeFrom(
|
||||
from._internal_imaploginfailedevent());
|
||||
break;
|
||||
}
|
||||
case EVENT_NOT_SET: {
|
||||
break;
|
||||
}
|
||||
@ -12618,6 +12669,12 @@ void UserEvent::clear_event() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kImapLoginFailedEvent: {
|
||||
if (GetArenaForAllocation() == nullptr) {
|
||||
delete _impl_.event_.imaploginfailedevent_;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_NOT_SET: {
|
||||
break;
|
||||
}
|
||||
@ -12682,6 +12739,14 @@ const char* UserEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
// .grpc.ImapLoginFailedEvent imapLoginFailedEvent = 6;
|
||||
case 6:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
|
||||
ptr = ctx->ParseMessage(_internal_mutable_imaploginfailedevent(), ptr);
|
||||
CHK_(ptr);
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
default:
|
||||
goto handle_unusual;
|
||||
} // switch
|
||||
@ -12746,6 +12811,13 @@ uint8_t* UserEvent::_InternalSerialize(
|
||||
_Internal::usedbyteschangedevent(this).GetCachedSize(), target, stream);
|
||||
}
|
||||
|
||||
// .grpc.ImapLoginFailedEvent imapLoginFailedEvent = 6;
|
||||
if (_internal_has_imaploginfailedevent()) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessage(6, _Internal::imaploginfailedevent(this),
|
||||
_Internal::imaploginfailedevent(this).GetCachedSize(), target, stream);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
|
||||
@ -12798,6 +12870,13 @@ size_t UserEvent::ByteSizeLong() const {
|
||||
*_impl_.event_.usedbyteschangedevent_);
|
||||
break;
|
||||
}
|
||||
// .grpc.ImapLoginFailedEvent imapLoginFailedEvent = 6;
|
||||
case kImapLoginFailedEvent: {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
|
||||
*_impl_.event_.imaploginfailedevent_);
|
||||
break;
|
||||
}
|
||||
case EVENT_NOT_SET: {
|
||||
break;
|
||||
}
|
||||
@ -12846,6 +12925,11 @@ void UserEvent::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROT
|
||||
from._internal_usedbyteschangedevent());
|
||||
break;
|
||||
}
|
||||
case kImapLoginFailedEvent: {
|
||||
_this->_internal_mutable_imaploginfailedevent()->::grpc::ImapLoginFailedEvent::MergeFrom(
|
||||
from._internal_imaploginfailedevent());
|
||||
break;
|
||||
}
|
||||
case EVENT_NOT_SET: {
|
||||
break;
|
||||
}
|
||||
@ -13971,6 +14055,209 @@ void UsedBytesChangedEvent::InternalSwap(UsedBytesChangedEvent* other) {
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class ImapLoginFailedEvent::_Internal {
|
||||
public:
|
||||
};
|
||||
|
||||
ImapLoginFailedEvent::ImapLoginFailedEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
|
||||
SharedCtor(arena, is_message_owned);
|
||||
// @@protoc_insertion_point(arena_constructor:grpc.ImapLoginFailedEvent)
|
||||
}
|
||||
ImapLoginFailedEvent::ImapLoginFailedEvent(const ImapLoginFailedEvent& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message() {
|
||||
ImapLoginFailedEvent* const _this = this; (void)_this;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.username_){}
|
||||
, /*decltype(_impl_._cached_size_)*/{}};
|
||||
|
||||
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
_impl_.username_.InitDefault();
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
_impl_.username_.Set("", GetArenaForAllocation());
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (!from._internal_username().empty()) {
|
||||
_this->_impl_.username_.Set(from._internal_username(),
|
||||
_this->GetArenaForAllocation());
|
||||
}
|
||||
// @@protoc_insertion_point(copy_constructor:grpc.ImapLoginFailedEvent)
|
||||
}
|
||||
|
||||
inline void ImapLoginFailedEvent::SharedCtor(
|
||||
::_pb::Arena* arena, bool is_message_owned) {
|
||||
(void)arena;
|
||||
(void)is_message_owned;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.username_){}
|
||||
, /*decltype(_impl_._cached_size_)*/{}
|
||||
};
|
||||
_impl_.username_.InitDefault();
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
_impl_.username_.Set("", GetArenaForAllocation());
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
}
|
||||
|
||||
ImapLoginFailedEvent::~ImapLoginFailedEvent() {
|
||||
// @@protoc_insertion_point(destructor:grpc.ImapLoginFailedEvent)
|
||||
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
|
||||
(void)arena;
|
||||
return;
|
||||
}
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
inline void ImapLoginFailedEvent::SharedDtor() {
|
||||
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
|
||||
_impl_.username_.Destroy();
|
||||
}
|
||||
|
||||
void ImapLoginFailedEvent::SetCachedSize(int size) const {
|
||||
_impl_._cached_size_.Set(size);
|
||||
}
|
||||
|
||||
void ImapLoginFailedEvent::Clear() {
|
||||
// @@protoc_insertion_point(message_clear_start:grpc.ImapLoginFailedEvent)
|
||||
uint32_t cached_has_bits = 0;
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
_impl_.username_.ClearToEmpty();
|
||||
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
|
||||
}
|
||||
|
||||
const char* ImapLoginFailedEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
|
||||
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
|
||||
while (!ctx->Done(&ptr)) {
|
||||
uint32_t tag;
|
||||
ptr = ::_pbi::ReadTag(ptr, &tag);
|
||||
switch (tag >> 3) {
|
||||
// string username = 1;
|
||||
case 1:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
|
||||
auto str = _internal_mutable_username();
|
||||
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
|
||||
CHK_(ptr);
|
||||
CHK_(::_pbi::VerifyUTF8(str, "grpc.ImapLoginFailedEvent.username"));
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
default:
|
||||
goto handle_unusual;
|
||||
} // switch
|
||||
handle_unusual:
|
||||
if ((tag == 0) || ((tag & 7) == 4)) {
|
||||
CHK_(ptr);
|
||||
ctx->SetLastTag(tag);
|
||||
goto message_done;
|
||||
}
|
||||
ptr = UnknownFieldParse(
|
||||
tag,
|
||||
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
|
||||
ptr, ctx);
|
||||
CHK_(ptr != nullptr);
|
||||
} // while
|
||||
message_done:
|
||||
return ptr;
|
||||
failure:
|
||||
ptr = nullptr;
|
||||
goto message_done;
|
||||
#undef CHK_
|
||||
}
|
||||
|
||||
uint8_t* ImapLoginFailedEvent::_InternalSerialize(
|
||||
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
|
||||
// @@protoc_insertion_point(serialize_to_array_start:grpc.ImapLoginFailedEvent)
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// string username = 1;
|
||||
if (!this->_internal_username().empty()) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->_internal_username().data(), static_cast<int>(this->_internal_username().length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"grpc.ImapLoginFailedEvent.username");
|
||||
target = stream->WriteStringMaybeAliased(
|
||||
1, this->_internal_username(), target);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
|
||||
}
|
||||
// @@protoc_insertion_point(serialize_to_array_end:grpc.ImapLoginFailedEvent)
|
||||
return target;
|
||||
}
|
||||
|
||||
size_t ImapLoginFailedEvent::ByteSizeLong() const {
|
||||
// @@protoc_insertion_point(message_byte_size_start:grpc.ImapLoginFailedEvent)
|
||||
size_t total_size = 0;
|
||||
|
||||
uint32_t cached_has_bits = 0;
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// string username = 1;
|
||||
if (!this->_internal_username().empty()) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
|
||||
this->_internal_username());
|
||||
}
|
||||
|
||||
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
|
||||
}
|
||||
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ImapLoginFailedEvent::_class_data_ = {
|
||||
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
|
||||
ImapLoginFailedEvent::MergeImpl
|
||||
};
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ImapLoginFailedEvent::GetClassData() const { return &_class_data_; }
|
||||
|
||||
|
||||
void ImapLoginFailedEvent::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
|
||||
auto* const _this = static_cast<ImapLoginFailedEvent*>(&to_msg);
|
||||
auto& from = static_cast<const ImapLoginFailedEvent&>(from_msg);
|
||||
// @@protoc_insertion_point(class_specific_merge_from_start:grpc.ImapLoginFailedEvent)
|
||||
GOOGLE_DCHECK_NE(&from, _this);
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (!from._internal_username().empty()) {
|
||||
_this->_internal_set_username(from._internal_username());
|
||||
}
|
||||
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
}
|
||||
|
||||
void ImapLoginFailedEvent::CopyFrom(const ImapLoginFailedEvent& from) {
|
||||
// @@protoc_insertion_point(class_specific_copy_from_start:grpc.ImapLoginFailedEvent)
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool ImapLoginFailedEvent::IsInitialized() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ImapLoginFailedEvent::InternalSwap(ImapLoginFailedEvent* other) {
|
||||
using std::swap;
|
||||
auto* lhs_arena = GetArenaForAllocation();
|
||||
auto* rhs_arena = other->GetArenaForAllocation();
|
||||
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
|
||||
&_impl_.username_, lhs_arena,
|
||||
&other->_impl_.username_, rhs_arena
|
||||
);
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata ImapLoginFailedEvent::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_bridge_2eproto_getter, &descriptor_table_bridge_2eproto_once,
|
||||
file_level_metadata_bridge_2eproto[58]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class GenericErrorEvent::_Internal {
|
||||
public:
|
||||
};
|
||||
@ -14147,7 +14434,7 @@ void GenericErrorEvent::InternalSwap(GenericErrorEvent* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata GenericErrorEvent::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_bridge_2eproto_getter, &descriptor_table_bridge_2eproto_once,
|
||||
file_level_metadata_bridge_2eproto[58]);
|
||||
file_level_metadata_bridge_2eproto[59]);
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
@ -14385,6 +14672,10 @@ template<> PROTOBUF_NOINLINE ::grpc::UsedBytesChangedEvent*
|
||||
Arena::CreateMaybeMessage< ::grpc::UsedBytesChangedEvent >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::grpc::UsedBytesChangedEvent >(arena);
|
||||
}
|
||||
template<> PROTOBUF_NOINLINE ::grpc::ImapLoginFailedEvent*
|
||||
Arena::CreateMaybeMessage< ::grpc::ImapLoginFailedEvent >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::grpc::ImapLoginFailedEvent >(arena);
|
||||
}
|
||||
template<> PROTOBUF_NOINLINE ::grpc::GenericErrorEvent*
|
||||
Arena::CreateMaybeMessage< ::grpc::GenericErrorEvent >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::grpc::GenericErrorEvent >(arena);
|
||||
|
||||
@ -100,6 +100,9 @@ extern GuiReadyResponseDefaultTypeInternal _GuiReadyResponse_default_instance_;
|
||||
class HasNoKeychainEvent;
|
||||
struct HasNoKeychainEventDefaultTypeInternal;
|
||||
extern HasNoKeychainEventDefaultTypeInternal _HasNoKeychainEvent_default_instance_;
|
||||
class ImapLoginFailedEvent;
|
||||
struct ImapLoginFailedEventDefaultTypeInternal;
|
||||
extern ImapLoginFailedEventDefaultTypeInternal _ImapLoginFailedEvent_default_instance_;
|
||||
class ImapSmtpSettings;
|
||||
struct ImapSmtpSettingsDefaultTypeInternal;
|
||||
extern ImapSmtpSettingsDefaultTypeInternal _ImapSmtpSettings_default_instance_;
|
||||
@ -245,6 +248,7 @@ template<> ::grpc::EventStreamRequest* Arena::CreateMaybeMessage<::grpc::EventSt
|
||||
template<> ::grpc::GenericErrorEvent* Arena::CreateMaybeMessage<::grpc::GenericErrorEvent>(Arena*);
|
||||
template<> ::grpc::GuiReadyResponse* Arena::CreateMaybeMessage<::grpc::GuiReadyResponse>(Arena*);
|
||||
template<> ::grpc::HasNoKeychainEvent* Arena::CreateMaybeMessage<::grpc::HasNoKeychainEvent>(Arena*);
|
||||
template<> ::grpc::ImapLoginFailedEvent* Arena::CreateMaybeMessage<::grpc::ImapLoginFailedEvent>(Arena*);
|
||||
template<> ::grpc::ImapSmtpSettings* Arena::CreateMaybeMessage<::grpc::ImapSmtpSettings>(Arena*);
|
||||
template<> ::grpc::InternetStatusEvent* Arena::CreateMaybeMessage<::grpc::InternetStatusEvent>(Arena*);
|
||||
template<> ::grpc::KeychainEvent* Arena::CreateMaybeMessage<::grpc::KeychainEvent>(Arena*);
|
||||
@ -9082,6 +9086,7 @@ class UserEvent final :
|
||||
kUserChanged = 3,
|
||||
kUserBadEvent = 4,
|
||||
kUsedBytesChangedEvent = 5,
|
||||
kImapLoginFailedEvent = 6,
|
||||
EVENT_NOT_SET = 0,
|
||||
};
|
||||
|
||||
@ -9168,6 +9173,7 @@ class UserEvent final :
|
||||
kUserChangedFieldNumber = 3,
|
||||
kUserBadEventFieldNumber = 4,
|
||||
kUsedBytesChangedEventFieldNumber = 5,
|
||||
kImapLoginFailedEventFieldNumber = 6,
|
||||
};
|
||||
// .grpc.ToggleSplitModeFinishedEvent toggleSplitModeFinished = 1;
|
||||
bool has_togglesplitmodefinished() const;
|
||||
@ -9259,6 +9265,24 @@ class UserEvent final :
|
||||
::grpc::UsedBytesChangedEvent* usedbyteschangedevent);
|
||||
::grpc::UsedBytesChangedEvent* unsafe_arena_release_usedbyteschangedevent();
|
||||
|
||||
// .grpc.ImapLoginFailedEvent imapLoginFailedEvent = 6;
|
||||
bool has_imaploginfailedevent() const;
|
||||
private:
|
||||
bool _internal_has_imaploginfailedevent() const;
|
||||
public:
|
||||
void clear_imaploginfailedevent();
|
||||
const ::grpc::ImapLoginFailedEvent& imaploginfailedevent() const;
|
||||
PROTOBUF_NODISCARD ::grpc::ImapLoginFailedEvent* release_imaploginfailedevent();
|
||||
::grpc::ImapLoginFailedEvent* mutable_imaploginfailedevent();
|
||||
void set_allocated_imaploginfailedevent(::grpc::ImapLoginFailedEvent* imaploginfailedevent);
|
||||
private:
|
||||
const ::grpc::ImapLoginFailedEvent& _internal_imaploginfailedevent() const;
|
||||
::grpc::ImapLoginFailedEvent* _internal_mutable_imaploginfailedevent();
|
||||
public:
|
||||
void unsafe_arena_set_allocated_imaploginfailedevent(
|
||||
::grpc::ImapLoginFailedEvent* imaploginfailedevent);
|
||||
::grpc::ImapLoginFailedEvent* unsafe_arena_release_imaploginfailedevent();
|
||||
|
||||
void clear_event();
|
||||
EventCase event_case() const;
|
||||
// @@protoc_insertion_point(class_scope:grpc.UserEvent)
|
||||
@ -9269,6 +9293,7 @@ class UserEvent final :
|
||||
void set_has_userchanged();
|
||||
void set_has_userbadevent();
|
||||
void set_has_usedbyteschangedevent();
|
||||
void set_has_imaploginfailedevent();
|
||||
|
||||
inline bool has_event() const;
|
||||
inline void clear_has_event();
|
||||
@ -9285,6 +9310,7 @@ class UserEvent final :
|
||||
::grpc::UserChangedEvent* userchanged_;
|
||||
::grpc::UserBadEvent* userbadevent_;
|
||||
::grpc::UsedBytesChangedEvent* usedbyteschangedevent_;
|
||||
::grpc::ImapLoginFailedEvent* imaploginfailedevent_;
|
||||
} event_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
uint32_t _oneof_case_[1];
|
||||
@ -10087,6 +10113,159 @@ class UsedBytesChangedEvent final :
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class ImapLoginFailedEvent final :
|
||||
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grpc.ImapLoginFailedEvent) */ {
|
||||
public:
|
||||
inline ImapLoginFailedEvent() : ImapLoginFailedEvent(nullptr) {}
|
||||
~ImapLoginFailedEvent() override;
|
||||
explicit PROTOBUF_CONSTEXPR ImapLoginFailedEvent(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
|
||||
|
||||
ImapLoginFailedEvent(const ImapLoginFailedEvent& from);
|
||||
ImapLoginFailedEvent(ImapLoginFailedEvent&& from) noexcept
|
||||
: ImapLoginFailedEvent() {
|
||||
*this = ::std::move(from);
|
||||
}
|
||||
|
||||
inline ImapLoginFailedEvent& operator=(const ImapLoginFailedEvent& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
inline ImapLoginFailedEvent& operator=(ImapLoginFailedEvent&& from) noexcept {
|
||||
if (this == &from) return *this;
|
||||
if (GetOwningArena() == from.GetOwningArena()
|
||||
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
|
||||
&& GetOwningArena() != nullptr
|
||||
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
|
||||
) {
|
||||
InternalSwap(&from);
|
||||
} else {
|
||||
CopyFrom(from);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
|
||||
return GetDescriptor();
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
|
||||
return default_instance().GetMetadata().descriptor;
|
||||
}
|
||||
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
|
||||
return default_instance().GetMetadata().reflection;
|
||||
}
|
||||
static const ImapLoginFailedEvent& default_instance() {
|
||||
return *internal_default_instance();
|
||||
}
|
||||
static inline const ImapLoginFailedEvent* internal_default_instance() {
|
||||
return reinterpret_cast<const ImapLoginFailedEvent*>(
|
||||
&_ImapLoginFailedEvent_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
58;
|
||||
|
||||
friend void swap(ImapLoginFailedEvent& a, ImapLoginFailedEvent& b) {
|
||||
a.Swap(&b);
|
||||
}
|
||||
inline void Swap(ImapLoginFailedEvent* other) {
|
||||
if (other == this) return;
|
||||
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
|
||||
if (GetOwningArena() != nullptr &&
|
||||
GetOwningArena() == other->GetOwningArena()) {
|
||||
#else // PROTOBUF_FORCE_COPY_IN_SWAP
|
||||
if (GetOwningArena() == other->GetOwningArena()) {
|
||||
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
|
||||
InternalSwap(other);
|
||||
} else {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
|
||||
}
|
||||
}
|
||||
void UnsafeArenaSwap(ImapLoginFailedEvent* other) {
|
||||
if (other == this) return;
|
||||
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
|
||||
InternalSwap(other);
|
||||
}
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
ImapLoginFailedEvent* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
|
||||
return CreateMaybeMessage<ImapLoginFailedEvent>(arena);
|
||||
}
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
|
||||
void CopyFrom(const ImapLoginFailedEvent& from);
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
|
||||
void MergeFrom( const ImapLoginFailedEvent& from) {
|
||||
ImapLoginFailedEvent::MergeImpl(*this, from);
|
||||
}
|
||||
private:
|
||||
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
|
||||
public:
|
||||
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
|
||||
bool IsInitialized() const final;
|
||||
|
||||
size_t ByteSizeLong() const final;
|
||||
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
|
||||
uint8_t* _InternalSerialize(
|
||||
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
|
||||
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
|
||||
|
||||
private:
|
||||
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const final;
|
||||
void InternalSwap(ImapLoginFailedEvent* other);
|
||||
|
||||
private:
|
||||
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
|
||||
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
|
||||
return "grpc.ImapLoginFailedEvent";
|
||||
}
|
||||
protected:
|
||||
explicit ImapLoginFailedEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned = false);
|
||||
public:
|
||||
|
||||
static const ClassData _class_data_;
|
||||
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kUsernameFieldNumber = 1,
|
||||
};
|
||||
// string username = 1;
|
||||
void clear_username();
|
||||
const std::string& username() const;
|
||||
template <typename ArgT0 = const std::string&, typename... ArgT>
|
||||
void set_username(ArgT0&& arg0, ArgT... args);
|
||||
std::string* mutable_username();
|
||||
PROTOBUF_NODISCARD std::string* release_username();
|
||||
void set_allocated_username(std::string* username);
|
||||
private:
|
||||
const std::string& _internal_username() const;
|
||||
inline PROTOBUF_ALWAYS_INLINE void _internal_set_username(const std::string& value);
|
||||
std::string* _internal_mutable_username();
|
||||
public:
|
||||
|
||||
// @@protoc_insertion_point(class_scope:grpc.ImapLoginFailedEvent)
|
||||
private:
|
||||
class _Internal;
|
||||
|
||||
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
|
||||
typedef void InternalArenaConstructable_;
|
||||
typedef void DestructorSkippable_;
|
||||
struct Impl_ {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr username_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
};
|
||||
union { Impl_ _impl_; };
|
||||
friend struct ::TableStruct_bridge_2eproto;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class GenericErrorEvent final :
|
||||
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grpc.GenericErrorEvent) */ {
|
||||
public:
|
||||
@ -10135,7 +10314,7 @@ class GenericErrorEvent final :
|
||||
&_GenericErrorEvent_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
58;
|
||||
59;
|
||||
|
||||
friend void swap(GenericErrorEvent& a, GenericErrorEvent& b) {
|
||||
a.Swap(&b);
|
||||
@ -15992,6 +16171,80 @@ inline ::grpc::UsedBytesChangedEvent* UserEvent::mutable_usedbyteschangedevent()
|
||||
return _msg;
|
||||
}
|
||||
|
||||
// .grpc.ImapLoginFailedEvent imapLoginFailedEvent = 6;
|
||||
inline bool UserEvent::_internal_has_imaploginfailedevent() const {
|
||||
return event_case() == kImapLoginFailedEvent;
|
||||
}
|
||||
inline bool UserEvent::has_imaploginfailedevent() const {
|
||||
return _internal_has_imaploginfailedevent();
|
||||
}
|
||||
inline void UserEvent::set_has_imaploginfailedevent() {
|
||||
_impl_._oneof_case_[0] = kImapLoginFailedEvent;
|
||||
}
|
||||
inline void UserEvent::clear_imaploginfailedevent() {
|
||||
if (_internal_has_imaploginfailedevent()) {
|
||||
if (GetArenaForAllocation() == nullptr) {
|
||||
delete _impl_.event_.imaploginfailedevent_;
|
||||
}
|
||||
clear_has_event();
|
||||
}
|
||||
}
|
||||
inline ::grpc::ImapLoginFailedEvent* UserEvent::release_imaploginfailedevent() {
|
||||
// @@protoc_insertion_point(field_release:grpc.UserEvent.imapLoginFailedEvent)
|
||||
if (_internal_has_imaploginfailedevent()) {
|
||||
clear_has_event();
|
||||
::grpc::ImapLoginFailedEvent* temp = _impl_.event_.imaploginfailedevent_;
|
||||
if (GetArenaForAllocation() != nullptr) {
|
||||
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
|
||||
}
|
||||
_impl_.event_.imaploginfailedevent_ = nullptr;
|
||||
return temp;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
inline const ::grpc::ImapLoginFailedEvent& UserEvent::_internal_imaploginfailedevent() const {
|
||||
return _internal_has_imaploginfailedevent()
|
||||
? *_impl_.event_.imaploginfailedevent_
|
||||
: reinterpret_cast< ::grpc::ImapLoginFailedEvent&>(::grpc::_ImapLoginFailedEvent_default_instance_);
|
||||
}
|
||||
inline const ::grpc::ImapLoginFailedEvent& UserEvent::imaploginfailedevent() const {
|
||||
// @@protoc_insertion_point(field_get:grpc.UserEvent.imapLoginFailedEvent)
|
||||
return _internal_imaploginfailedevent();
|
||||
}
|
||||
inline ::grpc::ImapLoginFailedEvent* UserEvent::unsafe_arena_release_imaploginfailedevent() {
|
||||
// @@protoc_insertion_point(field_unsafe_arena_release:grpc.UserEvent.imapLoginFailedEvent)
|
||||
if (_internal_has_imaploginfailedevent()) {
|
||||
clear_has_event();
|
||||
::grpc::ImapLoginFailedEvent* temp = _impl_.event_.imaploginfailedevent_;
|
||||
_impl_.event_.imaploginfailedevent_ = nullptr;
|
||||
return temp;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
inline void UserEvent::unsafe_arena_set_allocated_imaploginfailedevent(::grpc::ImapLoginFailedEvent* imaploginfailedevent) {
|
||||
clear_event();
|
||||
if (imaploginfailedevent) {
|
||||
set_has_imaploginfailedevent();
|
||||
_impl_.event_.imaploginfailedevent_ = imaploginfailedevent;
|
||||
}
|
||||
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:grpc.UserEvent.imapLoginFailedEvent)
|
||||
}
|
||||
inline ::grpc::ImapLoginFailedEvent* UserEvent::_internal_mutable_imaploginfailedevent() {
|
||||
if (!_internal_has_imaploginfailedevent()) {
|
||||
clear_event();
|
||||
set_has_imaploginfailedevent();
|
||||
_impl_.event_.imaploginfailedevent_ = CreateMaybeMessage< ::grpc::ImapLoginFailedEvent >(GetArenaForAllocation());
|
||||
}
|
||||
return _impl_.event_.imaploginfailedevent_;
|
||||
}
|
||||
inline ::grpc::ImapLoginFailedEvent* UserEvent::mutable_imaploginfailedevent() {
|
||||
::grpc::ImapLoginFailedEvent* _msg = _internal_mutable_imaploginfailedevent();
|
||||
// @@protoc_insertion_point(field_mutable:grpc.UserEvent.imapLoginFailedEvent)
|
||||
return _msg;
|
||||
}
|
||||
|
||||
inline bool UserEvent::has_event() const {
|
||||
return event_case() != EVENT_NOT_SET;
|
||||
}
|
||||
@ -16343,6 +16596,60 @@ inline void UsedBytesChangedEvent::set_usedbytes(int64_t value) {
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// ImapLoginFailedEvent
|
||||
|
||||
// string username = 1;
|
||||
inline void ImapLoginFailedEvent::clear_username() {
|
||||
_impl_.username_.ClearToEmpty();
|
||||
}
|
||||
inline const std::string& ImapLoginFailedEvent::username() const {
|
||||
// @@protoc_insertion_point(field_get:grpc.ImapLoginFailedEvent.username)
|
||||
return _internal_username();
|
||||
}
|
||||
template <typename ArgT0, typename... ArgT>
|
||||
inline PROTOBUF_ALWAYS_INLINE
|
||||
void ImapLoginFailedEvent::set_username(ArgT0&& arg0, ArgT... args) {
|
||||
|
||||
_impl_.username_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
|
||||
// @@protoc_insertion_point(field_set:grpc.ImapLoginFailedEvent.username)
|
||||
}
|
||||
inline std::string* ImapLoginFailedEvent::mutable_username() {
|
||||
std::string* _s = _internal_mutable_username();
|
||||
// @@protoc_insertion_point(field_mutable:grpc.ImapLoginFailedEvent.username)
|
||||
return _s;
|
||||
}
|
||||
inline const std::string& ImapLoginFailedEvent::_internal_username() const {
|
||||
return _impl_.username_.Get();
|
||||
}
|
||||
inline void ImapLoginFailedEvent::_internal_set_username(const std::string& value) {
|
||||
|
||||
_impl_.username_.Set(value, GetArenaForAllocation());
|
||||
}
|
||||
inline std::string* ImapLoginFailedEvent::_internal_mutable_username() {
|
||||
|
||||
return _impl_.username_.Mutable(GetArenaForAllocation());
|
||||
}
|
||||
inline std::string* ImapLoginFailedEvent::release_username() {
|
||||
// @@protoc_insertion_point(field_release:grpc.ImapLoginFailedEvent.username)
|
||||
return _impl_.username_.Release();
|
||||
}
|
||||
inline void ImapLoginFailedEvent::set_allocated_username(std::string* username) {
|
||||
if (username != nullptr) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
_impl_.username_.SetAllocated(username, GetArenaForAllocation());
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (_impl_.username_.IsDefault()) {
|
||||
_impl_.username_.Set("", GetArenaForAllocation());
|
||||
}
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
// @@protoc_insertion_point(field_set_allocated:grpc.ImapLoginFailedEvent.username)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// GenericErrorEvent
|
||||
|
||||
// .grpc.ErrorCode code = 1;
|
||||
@ -16484,6 +16791,8 @@ inline void GenericErrorEvent::set_code(::grpc::ErrorCode value) {
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
|
||||
@ -34,7 +34,8 @@ SPUser User::newUser(QObject *parent) {
|
||||
/// \param[in] parent The parent object.
|
||||
//****************************************************************************************************************************************************
|
||||
User::User(QObject *parent)
|
||||
: QObject(parent) {
|
||||
: QObject(parent)
|
||||
, imapFailureCooldownEndTime_(QDateTime::currentDateTime()) {
|
||||
|
||||
}
|
||||
|
||||
@ -311,4 +312,24 @@ QString User::stateToString(UserState state) {
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// We display a notification and pop the application window if an IMAP client tries to connect to a signed out account, but we do not want to
|
||||
/// do it repeatedly, as it's an intrusive action. This function let's you define a period of time during which the notification should not be
|
||||
/// displayed.
|
||||
///
|
||||
/// \param durationMSecs The duration of the period in milliseconds.
|
||||
//****************************************************************************************************************************************************
|
||||
void User::startImapLoginFailureCooldown(qint64 durationMSecs) {
|
||||
imapFailureCooldownEndTime_ = QDateTime::currentDateTime().addMSecs(durationMSecs);
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return true if we currently are in a cooldown period for the notification
|
||||
//****************************************************************************************************************************************************
|
||||
bool User::isInIMAPLoginFailureCooldown() const {
|
||||
return QDateTime::currentDateTime() < imapFailureCooldownEndTime_;
|
||||
}
|
||||
|
||||
|
||||
} // namespace bridgepp
|
||||
|
||||
@ -74,6 +74,8 @@ public: // member functions.
|
||||
User &operator=(User &&) = delete; ///< Disabled move assignment operator.
|
||||
void update(User const &user); ///< Update the user.
|
||||
Q_INVOKABLE QString primaryEmailOrUsername() const; ///< Return the user primary email, or, if unknown its username.
|
||||
void startImapLoginFailureCooldown(qint64 durationMSecs); ///< Start the user cooldown period for the IMAP login attempt while signed-out notification.
|
||||
bool isInIMAPLoginFailureCooldown() const; ///< Check if the user in a IMAP login failure notification.
|
||||
|
||||
public slots:
|
||||
// slots for QML generated calls
|
||||
@ -137,6 +139,7 @@ private: // member functions.
|
||||
User(QObject *parent); ///< Default constructor.
|
||||
|
||||
private: // data members.
|
||||
QDateTime imapFailureCooldownEndTime_; ///< The end date/time for the IMAP login failure notification cooldown period.
|
||||
QString id_; ///< The userID.
|
||||
QString username_; ///< The username
|
||||
QString password_; ///< The IMAP password of the user.
|
||||
|
||||
@ -261,7 +261,7 @@ func New(bridge *bridge.Bridge, restarter *restarter.Restarter, eventCh <-chan e
|
||||
return fe
|
||||
}
|
||||
|
||||
func (f *frontendCLI) watchEvents(eventCh <-chan events.Event) { // nolint:funlen
|
||||
func (f *frontendCLI) watchEvents(eventCh <-chan events.Event) { // nolint:funlen,gocyclo
|
||||
// GODT-1949: Better error events.
|
||||
for _, err := range f.bridge.GetErrors() {
|
||||
switch {
|
||||
@ -303,6 +303,9 @@ func (f *frontendCLI) watchEvents(eventCh <-chan events.Event) { // nolint:funle
|
||||
|
||||
f.Printf("User %s received a bad event and was logged out.\n", user.Username)
|
||||
|
||||
case events.IMAPLoginFailed:
|
||||
f.Printf("An IMAP login attempt failed for user %v\n", event.Username)
|
||||
|
||||
case events.UserAddressUpdated:
|
||||
user, err := f.bridge.GetUserInfo(event.UserID)
|
||||
if err != nil {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -448,7 +448,8 @@ message UserEvent {
|
||||
UserDisconnectedEvent userDisconnected = 2;
|
||||
UserChangedEvent userChanged = 3;
|
||||
UserBadEvent userBadEvent = 4;
|
||||
UsedBytesChangedEvent usedBytesChangedEvent= 5;
|
||||
UsedBytesChangedEvent usedBytesChangedEvent = 5;
|
||||
ImapLoginFailedEvent imapLoginFailedEvent = 6;
|
||||
}
|
||||
}
|
||||
|
||||
@ -474,6 +475,10 @@ message UsedBytesChangedEvent {
|
||||
int64 usedBytes = 2;
|
||||
}
|
||||
|
||||
message ImapLoginFailedEvent {
|
||||
string username = 1;
|
||||
}
|
||||
|
||||
//**********************************************************
|
||||
// Generic errors
|
||||
//**********************************************************
|
||||
|
||||
@ -181,6 +181,10 @@ func NewUsedBytesChangedEvent(userID string, usedBytes int) *StreamEvent {
|
||||
return userEvent(&UserEvent{Event: &UserEvent_UsedBytesChangedEvent{UsedBytesChangedEvent: &UsedBytesChangedEvent{UserID: userID, UsedBytes: int64(usedBytes)}}})
|
||||
}
|
||||
|
||||
func newIMAPLoginFailedEvent(username string) *StreamEvent {
|
||||
return userEvent(&UserEvent{Event: &UserEvent_ImapLoginFailedEvent{ImapLoginFailedEvent: &ImapLoginFailedEvent{Username: username}}})
|
||||
}
|
||||
|
||||
func NewGenericErrorEvent(errorCode ErrorCode) *StreamEvent {
|
||||
return genericErrorEvent(&GenericErrorEvent{Code: errorCode})
|
||||
}
|
||||
|
||||
@ -309,6 +309,9 @@ func (s *Service) watchEvents() {
|
||||
case events.UsedSpaceChanged:
|
||||
_ = s.SendEvent(NewUsedBytesChangedEvent(event.UserID, event.UsedSpace))
|
||||
|
||||
case events.IMAPLoginFailed:
|
||||
_ = s.SendEvent(newIMAPLoginFailedEvent(event.Username))
|
||||
|
||||
case events.UserDeauth:
|
||||
// This is the event the GUI cares about.
|
||||
_ = s.SendEvent(NewUserChangedEvent(event.UserID))
|
||||
|
||||
Reference in New Issue
Block a user