GODT-1770: handle UserBadEvent in CLI and gRPC.

This commit is contained in:
Xavier Michelon 2023-01-23 14:53:44 +01:00
parent f019ba3713
commit 5a70a16149
No known key found for this signature in database
GPG Key ID: DAE1FC3F3255843C
23 changed files with 1591 additions and 572 deletions

View File

@ -24,12 +24,11 @@
package proto
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
@ -105,7 +104,7 @@ var file_focus_proto_rawDesc = []byte{
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x6e,
0x4d, 0x61, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2d, 0x62, 0x72, 0x69, 0x64,
0x67, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x66,
0x67, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x66,
0x6f, 0x63, 0x75, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}

View File

@ -8,7 +8,6 @@ package proto
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"

View File

@ -51,6 +51,7 @@ UsersTab::UsersTab(QWidget *parent)
connect(ui_.buttonEditUser, &QPushButton::clicked, this, &UsersTab::onEditUserButton);
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_.checkUsernamePasswordError, &QCheckBox::toggled, this, &UsersTab::updateGUIState);
users_.append(randomUser());
@ -96,6 +97,8 @@ void UsersTab::onEditUserButton() {
if (grpc.isStreaming()) {
grpc.sendEvent(newUserChangedEvent(user->id()));
}
this->updateGUIState();
}
@ -125,13 +128,45 @@ void UsersTab::onSelectionChanged(QItemSelection, QItemSelection) {
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void UsersTab::onSendUserBadEvent() {
SPUser const user = selectedUser();
int const index = this->selectedIndex();
if (!user) {
app().log().error(QString("%1 failed. Unkown user.").arg(__FUNCTION__));
return;
}
if (UserState::SignedOut == user->state()) {
app().log().error(QString("%1 failed. User is already signed out").arg(__FUNCTION__));
}
user->setState(UserState::SignedOut);
users_.touch(index);
GRPCService &grpc = app().grpc();
if (grpc.isStreaming()) {
QString const userID = user->id();
grpc.sendEvent(newUserChangedEvent(userID));
grpc.sendEvent(newUserBadEvent(userID, ui_.editUserBadEvent->text()));
}
this->updateGUIState();
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void UsersTab::updateGUIState() {
bool const hasSelectedUser = ui_.tableUserList->selectionModel()->hasSelection();
SPUser const user = selectedUser();
bool const hasSelectedUser = user.get();
ui_.buttonEditUser->setEnabled(hasSelectedUser);
ui_.buttonRemoveUser->setEnabled(hasSelectedUser);
ui_.groupBoxBadEvent->setEnabled(hasSelectedUser && (UserState::SignedOut != user->state()));
ui_.editUsernamePasswordError->setEnabled(ui_.checkUsernamePasswordError->isChecked());
}

View File

@ -60,6 +60,7 @@ private slots:
void onEditUserButton(); ///< Edit the currently selected user.
void onRemoveUserButton(); ///< Remove the currently selected user.
void onSelectionChanged(QItemSelection, QItemSelection); ///< Slot for the change of the selection.
void onSendUserBadEvent(); ///< Slot for the 'Send Bad Event Error' button.
void updateGUIState(); ///< Update the GUI state.
private: // member functions.

View File

@ -67,7 +67,53 @@
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="groupBoxBadEvent">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Bad Event</string>
</property>
<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">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Bad event error.</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="buttonUserBadEvent">
<property name="text">
<string>Send Bad Event Error</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxNextLogin">
<property name="minimumSize">
<size>
<width>0</width>

View File

@ -880,6 +880,24 @@ void QMLBackend::onLoginAlreadyLoggedIn(QString const &userID) {
}
//****************************************************************************************************************************************************
/// \param[in] userID The userID.
/// \param[in] errorMessage. Unused
//****************************************************************************************************************************************************
void QMLBackend::onUserBadEvent(QString const &userID, QString const &errorMessage) {
HANDLE_EXCEPTION(
Q_UNUSED(errorMessage);
SPUser const user = users_->getUserWithID(userID);
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);
emit showMainWindow();
)
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
@ -987,5 +1005,6 @@ void QMLBackend::connectGrpcEvents() {
// user events
connect(client, &GRPCClient::userDisconnected, this, &QMLBackend::userDisconnected);
connect(client, &GRPCClient::userBadEvent, this, &QMLBackend::onUserBadEvent);
users_->connectGRPCEvents();
}

View File

@ -181,6 +181,7 @@ public slots: // slot for signals received from gRPC that need transformation in
void onGenericError(bridgepp::ErrorInfo const &info); ///< Slot for generic errors received from the gRPC service.
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.
signals: // Signals received from the Go backend, to be forwarded to QML
void toggleAutostartFinished(); ///< Signal for the 'toggleAutostartFinished' gRPC stream event.
@ -223,6 +224,7 @@ signals: // Signals received from the Go backend, to be forwarded to QML
void addressChangedLogout(QString const &address); ///< Signal for the 'addressChangedLogout' gRPC stream event.
void apiCertIssue(); ///< Signal for the 'apiCertIssue' gRPC stream event.
void userDisconnected(QString const &username); ///< Signal for the 'userDisconnected' gRPC stream event.
void userBadEvent(QString const &message); ///< Signal for the 'userBadEvent' gRPC stream event.
void internetOff(); ///< Signal for the 'internetOff' gRPC stream event.
void internetOn(); ///< Signal for the 'internetOn' gRPC stream event.
void resetFinished(); ///< Signal for the 'resetFinished' gRPC stream event.
@ -232,6 +234,7 @@ signals: // Signals received from the Go backend, to be forwarded to QML
void showMainWindow(); ///< Signal for the 'showMainWindow' gRPC stream event.
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.
// 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.

View File

@ -161,6 +161,17 @@ User *UserList::get(int row) const {
}
//****************************************************************************************************************************************************
/// \param[in] userID The userID.
/// \return The primary email address (or if unknown the username) of the user.
/// \return An empty string if the user cannot be found.
//****************************************************************************************************************************************************
QString UserList::primaryEmailOrUsername(QString const &userID) const {
SPUser const user = this->getUserWithID(userID);
return user ? user->primaryEmailOrUsername() : QString();
}
//****************************************************************************************************************************************************
/// \param[in] userID The userID.
//****************************************************************************************************************************************************

View File

@ -54,6 +54,7 @@ signals:
public:
Q_INVOKABLE bridgepp::User *get(int row) const;
Q_INVOKABLE QString primaryEmailOrUsername(QString const& userID) const; ///< Return the primary email or username of a user
public slots: ///< handler for signals coming from the gRPC service
void onUserChanged(QString const &userID);

View File

@ -399,4 +399,20 @@ Item {
signIn.username = username
rightContent.showSignIn()
}
function selectUser(userID) {
var users = Backend.users;
for (var i = 0; i < users.count; i++) {
var user = users.get(i)
if (user.id !== userID) {
continue;
}
accounts.currentIndex = i;
if (user.state === EUserState.SignedOut)
showSignIn(user.primaryEmailOrUsername())
return;
}
console.error("User with ID ", userID, " was not found in the account list")
}
}

View File

@ -86,6 +86,10 @@ ApplicationWindow {
root.showAndRise()
}
function onSelectUser(userID) {
root.selectUser(userID)
}
function onLoginFinished(index, wasSignedOut) {
var user = Backend.users.get(index)
if (user && !wasSignedOut) {
@ -182,6 +186,7 @@ ApplicationWindow {
function showLocalCacheSettings() { contentWrapper.showLocalCacheSettings() }
function showSettings() { contentWrapper.showSettings() }
function showHelp() { contentWrapper.showHelp() }
function selectUser(userID) { contentWrapper.selectUser(userID) }
function showSignIn(username) {
if (contentLayout.currentIndex == 1) return

View File

@ -80,6 +80,7 @@ QtObject {
root.addressChanged,
root.apiCertIssue,
root.noActiveKeyForRecipient,
root.userBadEvent,
root.genericError
]
@ -1101,6 +1102,33 @@ QtObject {
]
}
property Notification userBadEvent: Notification {
title: qsTr("User was logged out")
brief: title
description: "#PlaceHolderText"
icon: "./icons/ic-exclamation-circle-filled.svg"
type: Notification.NotificationType.Danger
group: Notifications.Group.Connection
Connections {
target: Backend
function onUserBadEvent(message) {
root.userBadEvent.description = message
root.userBadEvent.active = true
}
}
action: [
Action {
text: qsTr("OK")
onTriggered: {
root.userBadEvent.active = false
}
}
]
}
property Notification genericError: Notification {
title: "#PlaceholderText#"
description: "#PlaceholderText#"

View File

@ -560,6 +560,20 @@ SPStreamEvent newUserChangedEvent(QString const &userID) {
}
//****************************************************************************************************************************************************
/// \param[in] userID The userID.
/// \param[in] errorMessage The errorMessage
//****************************************************************************************************************************************************
SPStreamEvent newUserBadEvent(QString const &userID, QString const &errorMessage) {
auto event = new grpc::UserBadEvent;
event->set_userid(userID.toStdString());
event->set_errormessage(errorMessage.toStdString());
auto userEvent = new grpc::UserEvent;
userEvent->set_allocated_userbadevent(event);
return wrapUserEvent(userEvent);
}
//****************************************************************************************************************************************************
/// \param[in] errorCode The error errorCode.
/// \return The event.

View File

@ -77,6 +77,7 @@ SPStreamEvent newApiCertIssueEvent(); ///< Create a new ApiCertIssueEvent event.
SPStreamEvent newToggleSplitModeFinishedEvent(QString const &userID); ///< Create a new ToggleSplitModeFinishedEvent event.
SPStreamEvent newUserDisconnectedEvent(QString const &username); ///< Create a new UserDisconnectedEvent event.
SPStreamEvent newUserChangedEvent(QString const &userID); ///< Create a new UserChangedEvent event.
SPStreamEvent newUserBadEvent(QString const &userID, QString const& errorMessage); ///< Create a new UserBadEvent event.
// Generic error event
SPStreamEvent newGenericErrorEvent(grpc::ErrorCode errorCode); ///< Create a new GenericErrrorEvent event.

View File

@ -1380,6 +1380,14 @@ void GRPCClient::processUserEvent(UserEvent const &event) {
emit userChanged(userID);
break;
}
case UserEvent::kUserBadEvent: {
UserBadEvent const& e = event.userbadevent();
QString const userID = QString::fromStdString(e.userid());
QString const errorMessage = QString::fromStdString(e.errormessage());
this->logTrace(QString("User event received: UserBadEvent (userID = %1, errorMessage = %2).").arg(userID, errorMessage));
emit userBadEvent(userID, errorMessage);
break;
}
default:
this->logError("Unknown User event received.");
}

View File

@ -180,6 +180,7 @@ signals:
void toggleSplitModeFinished(QString const &userID);
void userDisconnected(QString const &username);
void userChanged(QString const &userID);
void userBadEvent(QString const &userID, QString const& errorMessage);
public: // keychain related calls
grpc::Status availableKeychains(QStringList &outKeychains);

View File

@ -732,6 +732,20 @@ struct UserChangedEventDefaultTypeInternal {
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UserChangedEventDefaultTypeInternal _UserChangedEvent_default_instance_;
PROTOBUF_CONSTEXPR UserBadEvent::UserBadEvent(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.userid_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.errormessage_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct UserBadEventDefaultTypeInternal {
PROTOBUF_CONSTEXPR UserBadEventDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~UserBadEventDefaultTypeInternal() {}
union {
UserBadEvent _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UserBadEventDefaultTypeInternal _UserBadEvent_default_instance_;
PROTOBUF_CONSTEXPR GenericErrorEvent::GenericErrorEvent(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.code_)*/0
@ -746,7 +760,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[56];
static ::_pb::Metadata file_level_metadata_bridge_2eproto[57];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_bridge_2eproto[7];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_bridge_2eproto = nullptr;
@ -1164,6 +1178,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_),
@ -1187,6 +1202,14 @@ const uint32_t TableStruct_bridge_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(p
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::grpc::UserChangedEvent, _impl_.userid_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::grpc::UserBadEvent, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::grpc::UserBadEvent, _impl_.userid_),
PROTOBUF_FIELD_OFFSET(::grpc::UserBadEvent, _impl_.errormessage_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::grpc::GenericErrorEvent, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
@ -1247,10 +1270,11 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
{ 391, -1, -1, sizeof(::grpc::AddressChangedLogoutEvent)},
{ 398, -1, -1, sizeof(::grpc::ApiCertIssueEvent)},
{ 404, -1, -1, sizeof(::grpc::UserEvent)},
{ 414, -1, -1, sizeof(::grpc::ToggleSplitModeFinishedEvent)},
{ 421, -1, -1, sizeof(::grpc::UserDisconnectedEvent)},
{ 428, -1, -1, sizeof(::grpc::UserChangedEvent)},
{ 435, -1, -1, sizeof(::grpc::GenericErrorEvent)},
{ 415, -1, -1, sizeof(::grpc::ToggleSplitModeFinishedEvent)},
{ 422, -1, -1, sizeof(::grpc::UserDisconnectedEvent)},
{ 429, -1, -1, sizeof(::grpc::UserChangedEvent)},
{ 436, -1, -1, sizeof(::grpc::UserBadEvent)},
{ 444, -1, -1, sizeof(::grpc::GenericErrorEvent)},
};
static const ::_pb::Message* const file_default_instances[] = {
@ -1309,6 +1333,7 @@ static const ::_pb::Message* const file_default_instances[] = {
&::grpc::_ToggleSplitModeFinishedEvent_default_instance_._instance,
&::grpc::_UserDisconnectedEvent_default_instance_._instance,
&::grpc::_UserChangedEvent_default_instance_._instance,
&::grpc::_UserBadEvent_default_instance_._instance,
&::grpc::_GenericErrorEvent_default_instance_._instance,
};
@ -1429,136 +1454,139 @@ const char descriptor_table_protodef_bridge_2eproto[] PROTOBUF_SECTION_VARIABLE(
"RecipientEvent\022\r\n\005email\030\001 \001(\t\"&\n\023Address"
"ChangedEvent\022\017\n\007address\030\001 \001(\t\",\n\031Address"
"ChangedLogoutEvent\022\017\n\007address\030\001 \001(\t\"\023\n\021A"
"piCertIssueEvent\"\303\001\n\tUserEvent\022E\n\027toggle"
"piCertIssueEvent\"\357\001\n\tUserEvent\022E\n\027toggle"
"SplitModeFinished\030\001 \001(\0132\".grpc.ToggleSpl"
"itModeFinishedEventH\000\0227\n\020userDisconnecte"
"d\030\002 \001(\0132\033.grpc.UserDisconnectedEventH\000\022-"
"\n\013userChanged\030\003 \001(\0132\026.grpc.UserChangedEv"
"entH\000B\007\n\005event\".\n\034ToggleSplitModeFinishe"
"dEvent\022\016\n\006userID\030\001 \001(\t\")\n\025UserDisconnect"
"edEvent\022\020\n\010username\030\001 \001(\t\"\"\n\020UserChanged"
"Event\022\016\n\006userID\030\001 \001(\t\"2\n\021GenericErrorEve"
"nt\022\035\n\004code\030\001 \001(\0162\017.grpc.ErrorCode*q\n\010Log"
"Level\022\r\n\tLOG_PANIC\020\000\022\r\n\tLOG_FATAL\020\001\022\r\n\tL"
"OG_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\tUserStat"
"e\022\016\n\nSIGNED_OUT\020\000\022\n\n\006LOCKED\020\001\022\r\n\tCONNECT"
"ED\020\002*\242\001\n\016LoginErrorType\022\033\n\027USERNAME_PASS"
"WORD_ERROR\020\000\022\r\n\tFREE_USER\020\001\022\024\n\020CONNECTIO"
"N_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_PASSWORD"
"S_ABORT\020\006*[\n\017UpdateErrorType\022\027\n\023UPDATE_M"
"ANUAL_ERROR\020\000\022\026\n\022UPDATE_FORCE_ERROR\020\001\022\027\n"
"\023UPDATE_SILENT_ERROR\020\002*k\n\022DiskCacheError"
"Type\022 \n\034DISK_CACHE_UNAVAILABLE_ERROR\020\000\022\036"
"\n\032CANT_MOVE_DISK_CACHE_ERROR\020\001\022\023\n\017DISK_F"
"ULL_ERROR\020\002*\335\001\n\033MailServerSettingsErrorT"
"ype\022\033\n\027IMAP_PORT_STARTUP_ERROR\020\000\022\033\n\027SMTP"
"_PORT_STARTUP_ERROR\020\001\022\032\n\026IMAP_PORT_CHANG"
"E_ERROR\020\002\022\032\n\026SMTP_PORT_CHANGE_ERROR\020\003\022%\n"
"!IMAP_CONNECTION_MODE_CHANGE_ERROR\020\004\022%\n!"
"SMTP_CONNECTION_MODE_CHANGE_ERROR\020\005*S\n\tE"
"rrorCode\022\021\n\rUNKNOWN_ERROR\020\000\022\031\n\025TLS_CERT_"
"EXPORT_ERROR\020\001\022\030\n\024TLS_KEY_EXPORT_ERROR\020\002"
"2\250\036\n\006Bridge\022I\n\013CheckTokens\022\034.google.prot"
"obuf.StringValue\032\034.google.protobuf.Strin"
"gValue\022\?\n\013AddLogEntry\022\030.grpc.AddLogEntry"
"Request\032\026.google.protobuf.Empty\022:\n\010GuiRe"
"ady\022\026.google.protobuf.Empty\032\026.google.pro"
"tobuf.Empty\0226\n\004Quit\022\026.google.protobuf.Em"
"pty\032\026.google.protobuf.Empty\0229\n\007Restart\022\026"
".google.protobuf.Empty\032\026.google.protobuf"
".Empty\022C\n\rShowOnStartup\022\026.google.protobu"
"f.Empty\032\032.google.protobuf.BoolValue\022F\n\020S"
"howSplashScreen\022\026.google.protobuf.Empty\032"
"\032.google.protobuf.BoolValue\022E\n\017IsFirstGu"
"iStart\022\026.google.protobuf.Empty\032\032.google."
"protobuf.BoolValue\022F\n\020SetIsAutostartOn\022\032"
".google.protobuf.BoolValue\032\026.google.prot"
"obuf.Empty\022C\n\rIsAutostartOn\022\026.google.pro"
"tobuf.Empty\032\032.google.protobuf.BoolValue\022"
"F\n\020SetIsBetaEnabled\022\032.google.protobuf.Bo"
"olValue\032\026.google.protobuf.Empty\022C\n\rIsBet"
"aEnabled\022\026.google.protobuf.Empty\032\032.googl"
"e.protobuf.BoolValue\022I\n\023SetIsAllMailVisi"
"ble\022\032.google.protobuf.BoolValue\032\026.google"
".protobuf.Empty\022F\n\020IsAllMailVisible\022\026.go"
"ogle.protobuf.Empty\032\032.google.protobuf.Bo"
"olValue\022<\n\004GoOs\022\026.google.protobuf.Empty\032"
"\034.google.protobuf.StringValue\022>\n\014Trigger"
"Reset\022\026.google.protobuf.Empty\032\026.google.p"
"rotobuf.Empty\022\?\n\007Version\022\026.google.protob"
"uf.Empty\032\034.google.protobuf.StringValue\022@"
"\n\010LogsPath\022\026.google.protobuf.Empty\032\034.goo"
"gle.protobuf.StringValue\022C\n\013LicensePath\022"
"\026.google.protobuf.Empty\032\034.google.protobu"
"f.StringValue\022L\n\024ReleaseNotesPageLink\022\026."
"entH\000\022*\n\014userBadEvent\030\004 \001(\0132\022.grpc.UserB"
"adEventH\000B\007\n\005event\".\n\034ToggleSplitModeFin"
"ishedEvent\022\016\n\006userID\030\001 \001(\t\")\n\025UserDiscon"
"nectedEvent\022\020\n\010username\030\001 \001(\t\"\"\n\020UserCha"
"ngedEvent\022\016\n\006userID\030\001 \001(\t\"4\n\014UserBadEven"
"t\022\016\n\006userID\030\001 \001(\t\022\024\n\014errorMessage\030\002 \001(\t\""
"2\n\021GenericErrorEvent\022\035\n\004code\030\001 \001(\0162\017.grp"
"c.ErrorCode*q\n\010LogLevel\022\r\n\tLOG_PANIC\020\000\022\r"
"\n\tLOG_FATAL\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_T"
"RACE\020\006*6\n\tUserState\022\016\n\nSIGNED_OUT\020\000\022\n\n\006L"
"OCKED\020\001\022\r\n\tCONNECTED\020\002*\242\001\n\016LoginErrorTyp"
"e\022\033\n\027USERNAME_PASSWORD_ERROR\020\000\022\r\n\tFREE_U"
"SER\020\001\022\024\n\020CONNECTION_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\017UpdateErr"
"orType\022\027\n\023UPDATE_MANUAL_ERROR\020\000\022\026\n\022UPDAT"
"E_FORCE_ERROR\020\001\022\027\n\023UPDATE_SILENT_ERROR\020\002"
"*k\n\022DiskCacheErrorType\022 \n\034DISK_CACHE_UNA"
"VAILABLE_ERROR\020\000\022\036\n\032CANT_MOVE_DISK_CACHE"
"_ERROR\020\001\022\023\n\017DISK_FULL_ERROR\020\002*\335\001\n\033MailSe"
"rverSettingsErrorType\022\033\n\027IMAP_PORT_START"
"UP_ERROR\020\000\022\033\n\027SMTP_PORT_STARTUP_ERROR\020\001\022"
"\032\n\026IMAP_PORT_CHANGE_ERROR\020\002\022\032\n\026SMTP_PORT"
"_CHANGE_ERROR\020\003\022%\n!IMAP_CONNECTION_MODE_"
"CHANGE_ERROR\020\004\022%\n!SMTP_CONNECTION_MODE_C"
"HANGE_ERROR\020\005*S\n\tErrorCode\022\021\n\rUNKNOWN_ER"
"ROR\020\000\022\031\n\025TLS_CERT_EXPORT_ERROR\020\001\022\030\n\024TLS_"
"KEY_EXPORT_ERROR\020\0022\250\036\n\006Bridge\022I\n\013CheckTo"
"kens\022\034.google.protobuf.StringValue\032\034.goo"
"gle.protobuf.StringValue\022\?\n\013AddLogEntry\022"
"\030.grpc.AddLogEntryRequest\032\026.google.proto"
"buf.Empty\022:\n\010GuiReady\022\026.google.protobuf."
"Empty\032\026.google.protobuf.Empty\0226\n\004Quit\022\026."
"google.protobuf.Empty\032\026.google.protobuf."
"Empty\0229\n\007Restart\022\026.google.protobuf.Empty"
"\032\026.google.protobuf.Empty\022C\n\rShowOnStartu"
"p\022\026.google.protobuf.Empty\032\032.google.proto"
"buf.BoolValue\022F\n\020ShowSplashScreen\022\026.goog"
"le.protobuf.Empty\032\032.google.protobuf.Bool"
"Value\022E\n\017IsFirstGuiStart\022\026.google.protob"
"uf.Empty\032\032.google.protobuf.BoolValue\022F\n\020"
"SetIsAutostartOn\022\032.google.protobuf.BoolV"
"alue\032\026.google.protobuf.Empty\022C\n\rIsAutost"
"artOn\022\026.google.protobuf.Empty\032\032.google.p"
"rotobuf.BoolValue\022F\n\020SetIsBetaEnabled\022\032."
"google.protobuf.BoolValue\032\026.google.proto"
"buf.Empty\022C\n\rIsBetaEnabled\022\026.google.prot"
"obuf.Empty\032\032.google.protobuf.BoolValue\022I"
"\n\023SetIsAllMailVisible\022\032.google.protobuf."
"BoolValue\032\026.google.protobuf.Empty\022F\n\020IsA"
"llMailVisible\022\026.google.protobuf.Empty\032\032."
"google.protobuf.BoolValue\022<\n\004GoOs\022\026.goog"
"le.protobuf.Empty\032\034.google.protobuf.Stri"
"ngValue\022>\n\014TriggerReset\022\026.google.protobu"
"f.Empty\032\026.google.protobuf.Empty\022\?\n\007Versi"
"on\022\026.google.protobuf.Empty\032\034.google.prot"
"obuf.StringValue\022@\n\010LogsPath\022\026.google.pr"
"otobuf.Empty\032\034.google.protobuf.StringVal"
"ue\022C\n\013LicensePath\022\026.google.protobuf.Empt"
"y\032\034.google.protobuf.StringValue\022L\n\024Relea"
"seNotesPageLink\022\026.google.protobuf.Empty\032"
"\034.google.protobuf.StringValue\022N\n\026Depende"
"ncyLicensesLink\022\026.google.protobuf.Empty\032"
"\034.google.protobuf.StringValue\022G\n\017Landing"
"PageLink\022\026.google.protobuf.Empty\032\034.googl"
"e.protobuf.StringValue\022J\n\022SetColorScheme"
"Name\022\034.google.protobuf.StringValue\032\026.goo"
"gle.protobuf.Empty\022G\n\017ColorSchemeName\022\026."
"google.protobuf.Empty\032\034.google.protobuf."
"StringValue\022N\n\026DependencyLicensesLink\022\026."
"google.protobuf.Empty\032\034.google.protobuf."
"StringValue\022G\n\017LandingPageLink\022\026.google."
"protobuf.Empty\032\034.google.protobuf.StringV"
"alue\022J\n\022SetColorSchemeName\022\034.google.prot"
"obuf.StringValue\032\026.google.protobuf.Empty"
"\022G\n\017ColorSchemeName\022\026.google.protobuf.Em"
"pty\032\034.google.protobuf.StringValue\022J\n\022Cur"
"rentEmailClient\022\026.google.protobuf.Empty\032"
"\034.google.protobuf.StringValue\022;\n\tReportB"
"ug\022\026.grpc.ReportBugRequest\032\026.google.prot"
"obuf.Empty\022M\n\025ExportTLSCertificates\022\034.go"
"StringValue\022J\n\022CurrentEmailClient\022\026.goog"
"le.protobuf.Empty\032\034.google.protobuf.Stri"
"ngValue\022;\n\tReportBug\022\026.grpc.ReportBugReq"
"uest\032\026.google.protobuf.Empty\022M\n\025ExportTL"
"SCertificates\022\034.google.protobuf.StringVa"
"lue\032\026.google.protobuf.Empty\022E\n\rForceLaun"
"cher\022\034.google.protobuf.StringValue\032\026.goo"
"gle.protobuf.Empty\022I\n\021SetMainExecutable\022"
"\034.google.protobuf.StringValue\032\026.google.p"
"rotobuf.Empty\0223\n\005Login\022\022.grpc.LoginReque"
"st\032\026.google.protobuf.Empty\0226\n\010Login2FA\022\022"
".grpc.LoginRequest\032\026.google.protobuf.Emp"
"ty\022=\n\017Login2Passwords\022\022.grpc.LoginReques"
"t\032\026.google.protobuf.Empty\022=\n\nLoginAbort\022"
"\027.grpc.LoginAbortRequest\032\026.google.protob"
"uf.Empty\022=\n\013CheckUpdate\022\026.google.protobu"
"f.Empty\032\026.google.protobuf.Empty\022\?\n\rInsta"
"llUpdate\022\026.google.protobuf.Empty\032\026.googl"
"e.protobuf.Empty\022L\n\026SetIsAutomaticUpdate"
"On\022\032.google.protobuf.BoolValue\032\026.google."
"protobuf.Empty\022I\n\023IsAutomaticUpdateOn\022\026."
"google.protobuf.Empty\032\032.google.protobuf."
"BoolValue\022E\n\rDiskCachePath\022\026.google.prot"
"obuf.Empty\032\034.google.protobuf.StringValue"
"\022H\n\020SetDiskCachePath\022\034.google.protobuf.S"
"tringValue\032\026.google.protobuf.Empty\022E\n\017Se"
"tIsDoHEnabled\022\032.google.protobuf.BoolValu"
"e\032\026.google.protobuf.Empty\022B\n\014IsDoHEnable"
"d\022\026.google.protobuf.Empty\032\032.google.proto"
"buf.BoolValue\022D\n\022MailServerSettings\022\026.go"
"ogle.protobuf.Empty\032\026.grpc.ImapSmtpSetti"
"ngs\022G\n\025SetMailServerSettings\022\026.grpc.Imap"
"SmtpSettings\032\026.google.protobuf.Empty\022@\n\010"
"Hostname\022\026.google.protobuf.Empty\032\034.googl"
"e.protobuf.StringValue\022E\n\nIsPortFree\022\033.g"
"oogle.protobuf.Int32Value\032\032.google.proto"
"buf.BoolValue\022N\n\022AvailableKeychains\022\026.go"
"ogle.protobuf.Empty\032 .grpc.AvailableKeyc"
"hainsResponse\022J\n\022SetCurrentKeychain\022\034.go"
"ogle.protobuf.StringValue\032\026.google.proto"
"buf.Empty\022E\n\rForceLauncher\022\034.google.prot"
"obuf.StringValue\032\026.google.protobuf.Empty"
"\022I\n\021SetMainExecutable\022\034.google.protobuf."
"StringValue\032\026.google.protobuf.Empty\0223\n\005L"
"ogin\022\022.grpc.LoginRequest\032\026.google.protob"
"uf.Empty\0226\n\010Login2FA\022\022.grpc.LoginRequest"
"\032\026.google.protobuf.Empty\022=\n\017Login2Passwo"
"rds\022\022.grpc.LoginRequest\032\026.google.protobu"
"f.Empty\022=\n\nLoginAbort\022\027.grpc.LoginAbortR"
"equest\032\026.google.protobuf.Empty\022=\n\013CheckU"
"pdate\022\026.google.protobuf.Empty\032\026.google.p"
"rotobuf.Empty\022\?\n\rInstallUpdate\022\026.google."
"protobuf.Empty\032\026.google.protobuf.Empty\022L"
"\n\026SetIsAutomaticUpdateOn\022\032.google.protob"
"uf.BoolValue\032\026.google.protobuf.Empty\022I\n\023"
"IsAutomaticUpdateOn\022\026.google.protobuf.Em"
"pty\032\032.google.protobuf.BoolValue\022E\n\rDiskC"
"achePath\022\026.google.protobuf.Empty\032\034.googl"
"e.protobuf.StringValue\022H\n\020SetDiskCachePa"
"th\022\034.google.protobuf.StringValue\032\026.googl"
"e.protobuf.Empty\022E\n\017SetIsDoHEnabled\022\032.go"
"ogle.protobuf.BoolValue\032\026.google.protobu"
"f.Empty\022B\n\014IsDoHEnabled\022\026.google.protobu"
"f.Empty\032\032.google.protobuf.BoolValue\022D\n\022M"
"ailServerSettings\022\026.google.protobuf.Empt"
"y\032\026.grpc.ImapSmtpSettings\022G\n\025SetMailServ"
"erSettings\022\026.grpc.ImapSmtpSettings\032\026.goo"
"gle.protobuf.Empty\022@\n\010Hostname\022\026.google."
"protobuf.Empty\032\034.google.protobuf.StringV"
"alue\022E\n\nIsPortFree\022\033.google.protobuf.Int"
"32Value\032\032.google.protobuf.BoolValue\022N\n\022A"
"vailableKeychains\022\026.google.protobuf.Empt"
"y\032 .grpc.AvailableKeychainsResponse\022J\n\022S"
"etCurrentKeychain\022\034.google.protobuf.Stri"
"ngValue\032\026.google.protobuf.Empty\022G\n\017Curre"
"ntKeychain\022\026.google.protobuf.Empty\032\034.goo"
"gle.protobuf.StringValue\022=\n\013GetUserList\022"
"\026.google.protobuf.Empty\032\026.grpc.UserListR"
"esponse\0223\n\007GetUser\022\034.google.protobuf.Str"
"ingValue\032\n.grpc.User\022F\n\020SetUserSplitMode"
"\022\032.grpc.UserSplitModeRequest\032\026.google.pr"
"otobuf.Empty\022B\n\nLogoutUser\022\034.google.prot"
"obuf.StringValue\032\026.google.protobuf.Empty"
"\022B\n\nRemoveUser\022\034.google.protobuf.StringV"
"alue\032\026.google.protobuf.Empty\022Q\n\026Configur"
"eUserAppleMail\022\037.grpc.ConfigureAppleMail"
"Request\032\026.google.protobuf.Empty\022\?\n\016RunEv"
"entStream\022\030.grpc.EventStreamRequest\032\021.gr"
"pc.StreamEvent0\001\022A\n\017StopEventStream\022\026.go"
"ogle.protobuf.Empty\032\026.google.protobuf.Em"
"ptyB6Z4github.com/ProtonMail/proton-brid"
"ge/v3/internal/grpcb\006proto3"
"buf.Empty\022G\n\017CurrentKeychain\022\026.google.pr"
"otobuf.Empty\032\034.google.protobuf.StringVal"
"ue\022=\n\013GetUserList\022\026.google.protobuf.Empt"
"y\032\026.grpc.UserListResponse\0223\n\007GetUser\022\034.g"
"oogle.protobuf.StringValue\032\n.grpc.User\022F"
"\n\020SetUserSplitMode\022\032.grpc.UserSplitModeR"
"equest\032\026.google.protobuf.Empty\022B\n\nLogout"
"User\022\034.google.protobuf.StringValue\032\026.goo"
"gle.protobuf.Empty\022B\n\nRemoveUser\022\034.googl"
"e.protobuf.StringValue\032\026.google.protobuf"
".Empty\022Q\n\026ConfigureUserAppleMail\022\037.grpc."
"ConfigureAppleMailRequest\032\026.google.proto"
"buf.Empty\022\?\n\016RunEventStream\022\030.grpc.Event"
"StreamRequest\032\021.grpc.StreamEvent0\001\022A\n\017St"
"opEventStream\022\026.google.protobuf.Empty\032\026."
"google.protobuf.EmptyB6Z4github.com/Prot"
"onMail/proton-bridge/v3/internal/grpcb\006p"
"roto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_bridge_2eproto_deps[2] = {
&::descriptor_table_google_2fprotobuf_2fempty_2eproto,
@ -1566,9 +1594,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, 9827, descriptor_table_protodef_bridge_2eproto,
false, false, 9925, descriptor_table_protodef_bridge_2eproto,
"bridge.proto",
&descriptor_table_bridge_2eproto_once, descriptor_table_bridge_2eproto_deps, 2, 56,
&descriptor_table_bridge_2eproto_once, descriptor_table_bridge_2eproto_deps, 2, 57,
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,
@ -12152,6 +12180,7 @@ class UserEvent::_Internal {
static const ::grpc::ToggleSplitModeFinishedEvent& togglesplitmodefinished(const UserEvent* msg);
static const ::grpc::UserDisconnectedEvent& userdisconnected(const UserEvent* msg);
static const ::grpc::UserChangedEvent& userchanged(const UserEvent* msg);
static const ::grpc::UserBadEvent& userbadevent(const UserEvent* msg);
};
const ::grpc::ToggleSplitModeFinishedEvent&
@ -12166,6 +12195,10 @@ const ::grpc::UserChangedEvent&
UserEvent::_Internal::userchanged(const UserEvent* msg) {
return *msg->_impl_.event_.userchanged_;
}
const ::grpc::UserBadEvent&
UserEvent::_Internal::userbadevent(const UserEvent* msg) {
return *msg->_impl_.event_.userbadevent_;
}
void UserEvent::set_allocated_togglesplitmodefinished(::grpc::ToggleSplitModeFinishedEvent* togglesplitmodefinished) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
clear_event();
@ -12211,6 +12244,21 @@ void UserEvent::set_allocated_userchanged(::grpc::UserChangedEvent* userchanged)
}
// @@protoc_insertion_point(field_set_allocated:grpc.UserEvent.userChanged)
}
void UserEvent::set_allocated_userbadevent(::grpc::UserBadEvent* userbadevent) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
clear_event();
if (userbadevent) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(userbadevent);
if (message_arena != submessage_arena) {
userbadevent = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, userbadevent, submessage_arena);
}
set_has_userbadevent();
_impl_.event_.userbadevent_ = userbadevent;
}
// @@protoc_insertion_point(field_set_allocated:grpc.UserEvent.userBadEvent)
}
UserEvent::UserEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
@ -12243,6 +12291,11 @@ UserEvent::UserEvent(const UserEvent& from)
from._internal_userchanged());
break;
}
case kUserBadEvent: {
_this->_internal_mutable_userbadevent()->::grpc::UserBadEvent::MergeFrom(
from._internal_userbadevent());
break;
}
case EVENT_NOT_SET: {
break;
}
@ -12303,6 +12356,12 @@ void UserEvent::clear_event() {
}
break;
}
case kUserBadEvent: {
if (GetArenaForAllocation() == nullptr) {
delete _impl_.event_.userbadevent_;
}
break;
}
case EVENT_NOT_SET: {
break;
}
@ -12351,6 +12410,14 @@ const char* UserEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx
} else
goto handle_unusual;
continue;
// .grpc.UserBadEvent userBadEvent = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
ptr = ctx->ParseMessage(_internal_mutable_userbadevent(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
@ -12401,6 +12468,13 @@ uint8_t* UserEvent::_InternalSerialize(
_Internal::userchanged(this).GetCachedSize(), target, stream);
}
// .grpc.UserBadEvent userBadEvent = 4;
if (_internal_has_userbadevent()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(4, _Internal::userbadevent(this),
_Internal::userbadevent(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);
@ -12439,6 +12513,13 @@ size_t UserEvent::ByteSizeLong() const {
*_impl_.event_.userchanged_);
break;
}
// .grpc.UserBadEvent userBadEvent = 4;
case kUserBadEvent: {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.event_.userbadevent_);
break;
}
case EVENT_NOT_SET: {
break;
}
@ -12477,6 +12558,11 @@ void UserEvent::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROT
from._internal_userchanged());
break;
}
case kUserBadEvent: {
_this->_internal_mutable_userbadevent()->::grpc::UserBadEvent::MergeFrom(
from._internal_userbadevent());
break;
}
case EVENT_NOT_SET: {
break;
}
@ -13119,6 +13205,259 @@ void UserChangedEvent::InternalSwap(UserChangedEvent* other) {
// ===================================================================
class UserBadEvent::_Internal {
public:
};
UserBadEvent::UserBadEvent(::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.UserBadEvent)
}
UserBadEvent::UserBadEvent(const UserBadEvent& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
UserBadEvent* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.userid_){}
, decltype(_impl_.errormessage_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.userid_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.userid_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_userid().empty()) {
_this->_impl_.userid_.Set(from._internal_userid(),
_this->GetArenaForAllocation());
}
_impl_.errormessage_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.errormessage_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_errormessage().empty()) {
_this->_impl_.errormessage_.Set(from._internal_errormessage(),
_this->GetArenaForAllocation());
}
// @@protoc_insertion_point(copy_constructor:grpc.UserBadEvent)
}
inline void UserBadEvent::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.userid_){}
, decltype(_impl_.errormessage_){}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.userid_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.userid_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.errormessage_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.errormessage_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
UserBadEvent::~UserBadEvent() {
// @@protoc_insertion_point(destructor:grpc.UserBadEvent)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void UserBadEvent::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.userid_.Destroy();
_impl_.errormessage_.Destroy();
}
void UserBadEvent::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void UserBadEvent::Clear() {
// @@protoc_insertion_point(message_clear_start:grpc.UserBadEvent)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.userid_.ClearToEmpty();
_impl_.errormessage_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* UserBadEvent::_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 userID = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_userid();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "grpc.UserBadEvent.userID"));
} else
goto handle_unusual;
continue;
// string errorMessage = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_errormessage();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "grpc.UserBadEvent.errorMessage"));
} 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* UserBadEvent::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:grpc.UserBadEvent)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// string userID = 1;
if (!this->_internal_userid().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_userid().data(), static_cast<int>(this->_internal_userid().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"grpc.UserBadEvent.userID");
target = stream->WriteStringMaybeAliased(
1, this->_internal_userid(), target);
}
// string errorMessage = 2;
if (!this->_internal_errormessage().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_errormessage().data(), static_cast<int>(this->_internal_errormessage().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"grpc.UserBadEvent.errorMessage");
target = stream->WriteStringMaybeAliased(
2, this->_internal_errormessage(), 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.UserBadEvent)
return target;
}
size_t UserBadEvent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:grpc.UserBadEvent)
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 userID = 1;
if (!this->_internal_userid().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_userid());
}
// string errorMessage = 2;
if (!this->_internal_errormessage().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_errormessage());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData UserBadEvent::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
UserBadEvent::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*UserBadEvent::GetClassData() const { return &_class_data_; }
void UserBadEvent::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<UserBadEvent*>(&to_msg);
auto& from = static_cast<const UserBadEvent&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:grpc.UserBadEvent)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_userid().empty()) {
_this->_internal_set_userid(from._internal_userid());
}
if (!from._internal_errormessage().empty()) {
_this->_internal_set_errormessage(from._internal_errormessage());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void UserBadEvent::CopyFrom(const UserBadEvent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:grpc.UserBadEvent)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool UserBadEvent::IsInitialized() const {
return true;
}
void UserBadEvent::InternalSwap(UserBadEvent* 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_.userid_, lhs_arena,
&other->_impl_.userid_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.errormessage_, lhs_arena,
&other->_impl_.errormessage_, rhs_arena
);
}
::PROTOBUF_NAMESPACE_ID::Metadata UserBadEvent::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_bridge_2eproto_getter, &descriptor_table_bridge_2eproto_once,
file_level_metadata_bridge_2eproto[55]);
}
// ===================================================================
class GenericErrorEvent::_Internal {
public:
};
@ -13295,7 +13634,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[55]);
file_level_metadata_bridge_2eproto[56]);
}
// @@protoc_insertion_point(namespace_scope)
@ -13521,6 +13860,10 @@ template<> PROTOBUF_NOINLINE ::grpc::UserChangedEvent*
Arena::CreateMaybeMessage< ::grpc::UserChangedEvent >(Arena* arena) {
return Arena::CreateMessageInternal< ::grpc::UserChangedEvent >(arena);
}
template<> PROTOBUF_NOINLINE ::grpc::UserBadEvent*
Arena::CreateMaybeMessage< ::grpc::UserBadEvent >(Arena* arena) {
return Arena::CreateMessageInternal< ::grpc::UserBadEvent >(arena);
}
template<> PROTOBUF_NOINLINE ::grpc::GenericErrorEvent*
Arena::CreateMaybeMessage< ::grpc::GenericErrorEvent >(Arena* arena) {
return Arena::CreateMessageInternal< ::grpc::GenericErrorEvent >(arena);

View File

@ -202,6 +202,9 @@ extern UpdateVersionChangedDefaultTypeInternal _UpdateVersionChanged_default_ins
class User;
struct UserDefaultTypeInternal;
extern UserDefaultTypeInternal _User_default_instance_;
class UserBadEvent;
struct UserBadEventDefaultTypeInternal;
extern UserBadEventDefaultTypeInternal _UserBadEvent_default_instance_;
class UserChangedEvent;
struct UserChangedEventDefaultTypeInternal;
extern UserChangedEventDefaultTypeInternal _UserChangedEvent_default_instance_;
@ -270,6 +273,7 @@ template<> ::grpc::UpdateManualRestartNeededEvent* Arena::CreateMaybeMessage<::g
template<> ::grpc::UpdateSilentRestartNeeded* Arena::CreateMaybeMessage<::grpc::UpdateSilentRestartNeeded>(Arena*);
template<> ::grpc::UpdateVersionChanged* Arena::CreateMaybeMessage<::grpc::UpdateVersionChanged>(Arena*);
template<> ::grpc::User* Arena::CreateMaybeMessage<::grpc::User>(Arena*);
template<> ::grpc::UserBadEvent* Arena::CreateMaybeMessage<::grpc::UserBadEvent>(Arena*);
template<> ::grpc::UserChangedEvent* Arena::CreateMaybeMessage<::grpc::UserChangedEvent>(Arena*);
template<> ::grpc::UserDisconnectedEvent* Arena::CreateMaybeMessage<::grpc::UserDisconnectedEvent>(Arena*);
template<> ::grpc::UserEvent* Arena::CreateMaybeMessage<::grpc::UserEvent>(Arena*);
@ -8920,6 +8924,7 @@ class UserEvent final :
kToggleSplitModeFinished = 1,
kUserDisconnected = 2,
kUserChanged = 3,
kUserBadEvent = 4,
EVENT_NOT_SET = 0,
};
@ -9004,6 +9009,7 @@ class UserEvent final :
kToggleSplitModeFinishedFieldNumber = 1,
kUserDisconnectedFieldNumber = 2,
kUserChangedFieldNumber = 3,
kUserBadEventFieldNumber = 4,
};
// .grpc.ToggleSplitModeFinishedEvent toggleSplitModeFinished = 1;
bool has_togglesplitmodefinished() const;
@ -9059,6 +9065,24 @@ class UserEvent final :
::grpc::UserChangedEvent* userchanged);
::grpc::UserChangedEvent* unsafe_arena_release_userchanged();
// .grpc.UserBadEvent userBadEvent = 4;
bool has_userbadevent() const;
private:
bool _internal_has_userbadevent() const;
public:
void clear_userbadevent();
const ::grpc::UserBadEvent& userbadevent() const;
PROTOBUF_NODISCARD ::grpc::UserBadEvent* release_userbadevent();
::grpc::UserBadEvent* mutable_userbadevent();
void set_allocated_userbadevent(::grpc::UserBadEvent* userbadevent);
private:
const ::grpc::UserBadEvent& _internal_userbadevent() const;
::grpc::UserBadEvent* _internal_mutable_userbadevent();
public:
void unsafe_arena_set_allocated_userbadevent(
::grpc::UserBadEvent* userbadevent);
::grpc::UserBadEvent* unsafe_arena_release_userbadevent();
void clear_event();
EventCase event_case() const;
// @@protoc_insertion_point(class_scope:grpc.UserEvent)
@ -9067,6 +9091,7 @@ class UserEvent final :
void set_has_togglesplitmodefinished();
void set_has_userdisconnected();
void set_has_userchanged();
void set_has_userbadevent();
inline bool has_event() const;
inline void clear_has_event();
@ -9081,6 +9106,7 @@ class UserEvent final :
::grpc::ToggleSplitModeFinishedEvent* togglesplitmodefinished_;
::grpc::UserDisconnectedEvent* userdisconnected_;
::grpc::UserChangedEvent* userchanged_;
::grpc::UserBadEvent* userbadevent_;
} event_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
uint32_t _oneof_case_[1];
@ -9550,6 +9576,175 @@ class UserChangedEvent final :
};
// -------------------------------------------------------------------
class UserBadEvent final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grpc.UserBadEvent) */ {
public:
inline UserBadEvent() : UserBadEvent(nullptr) {}
~UserBadEvent() override;
explicit PROTOBUF_CONSTEXPR UserBadEvent(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
UserBadEvent(const UserBadEvent& from);
UserBadEvent(UserBadEvent&& from) noexcept
: UserBadEvent() {
*this = ::std::move(from);
}
inline UserBadEvent& operator=(const UserBadEvent& from) {
CopyFrom(from);
return *this;
}
inline UserBadEvent& operator=(UserBadEvent&& 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 UserBadEvent& default_instance() {
return *internal_default_instance();
}
static inline const UserBadEvent* internal_default_instance() {
return reinterpret_cast<const UserBadEvent*>(
&_UserBadEvent_default_instance_);
}
static constexpr int kIndexInFileMessages =
55;
friend void swap(UserBadEvent& a, UserBadEvent& b) {
a.Swap(&b);
}
inline void Swap(UserBadEvent* 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(UserBadEvent* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
UserBadEvent* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<UserBadEvent>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const UserBadEvent& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const UserBadEvent& from) {
UserBadEvent::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(UserBadEvent* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "grpc.UserBadEvent";
}
protected:
explicit UserBadEvent(::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 {
kUserIDFieldNumber = 1,
kErrorMessageFieldNumber = 2,
};
// string userID = 1;
void clear_userid();
const std::string& userid() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_userid(ArgT0&& arg0, ArgT... args);
std::string* mutable_userid();
PROTOBUF_NODISCARD std::string* release_userid();
void set_allocated_userid(std::string* userid);
private:
const std::string& _internal_userid() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_userid(const std::string& value);
std::string* _internal_mutable_userid();
public:
// string errorMessage = 2;
void clear_errormessage();
const std::string& errormessage() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_errormessage(ArgT0&& arg0, ArgT... args);
std::string* mutable_errormessage();
PROTOBUF_NODISCARD std::string* release_errormessage();
void set_allocated_errormessage(std::string* errormessage);
private:
const std::string& _internal_errormessage() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_errormessage(const std::string& value);
std::string* _internal_mutable_errormessage();
public:
// @@protoc_insertion_point(class_scope:grpc.UserBadEvent)
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 userid_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr errormessage_;
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:
@ -9598,7 +9793,7 @@ class GenericErrorEvent final :
&_GenericErrorEvent_default_instance_);
}
static constexpr int kIndexInFileMessages =
55;
56;
friend void swap(GenericErrorEvent& a, GenericErrorEvent& b) {
a.Swap(&b);
@ -15283,6 +15478,80 @@ inline ::grpc::UserChangedEvent* UserEvent::mutable_userchanged() {
return _msg;
}
// .grpc.UserBadEvent userBadEvent = 4;
inline bool UserEvent::_internal_has_userbadevent() const {
return event_case() == kUserBadEvent;
}
inline bool UserEvent::has_userbadevent() const {
return _internal_has_userbadevent();
}
inline void UserEvent::set_has_userbadevent() {
_impl_._oneof_case_[0] = kUserBadEvent;
}
inline void UserEvent::clear_userbadevent() {
if (_internal_has_userbadevent()) {
if (GetArenaForAllocation() == nullptr) {
delete _impl_.event_.userbadevent_;
}
clear_has_event();
}
}
inline ::grpc::UserBadEvent* UserEvent::release_userbadevent() {
// @@protoc_insertion_point(field_release:grpc.UserEvent.userBadEvent)
if (_internal_has_userbadevent()) {
clear_has_event();
::grpc::UserBadEvent* temp = _impl_.event_.userbadevent_;
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
_impl_.event_.userbadevent_ = nullptr;
return temp;
} else {
return nullptr;
}
}
inline const ::grpc::UserBadEvent& UserEvent::_internal_userbadevent() const {
return _internal_has_userbadevent()
? *_impl_.event_.userbadevent_
: reinterpret_cast< ::grpc::UserBadEvent&>(::grpc::_UserBadEvent_default_instance_);
}
inline const ::grpc::UserBadEvent& UserEvent::userbadevent() const {
// @@protoc_insertion_point(field_get:grpc.UserEvent.userBadEvent)
return _internal_userbadevent();
}
inline ::grpc::UserBadEvent* UserEvent::unsafe_arena_release_userbadevent() {
// @@protoc_insertion_point(field_unsafe_arena_release:grpc.UserEvent.userBadEvent)
if (_internal_has_userbadevent()) {
clear_has_event();
::grpc::UserBadEvent* temp = _impl_.event_.userbadevent_;
_impl_.event_.userbadevent_ = nullptr;
return temp;
} else {
return nullptr;
}
}
inline void UserEvent::unsafe_arena_set_allocated_userbadevent(::grpc::UserBadEvent* userbadevent) {
clear_event();
if (userbadevent) {
set_has_userbadevent();
_impl_.event_.userbadevent_ = userbadevent;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:grpc.UserEvent.userBadEvent)
}
inline ::grpc::UserBadEvent* UserEvent::_internal_mutable_userbadevent() {
if (!_internal_has_userbadevent()) {
clear_event();
set_has_userbadevent();
_impl_.event_.userbadevent_ = CreateMaybeMessage< ::grpc::UserBadEvent >(GetArenaForAllocation());
}
return _impl_.event_.userbadevent_;
}
inline ::grpc::UserBadEvent* UserEvent::mutable_userbadevent() {
::grpc::UserBadEvent* _msg = _internal_mutable_userbadevent();
// @@protoc_insertion_point(field_mutable:grpc.UserEvent.userBadEvent)
return _msg;
}
inline bool UserEvent::has_event() const {
return event_case() != EVENT_NOT_SET;
}
@ -15456,6 +15725,110 @@ inline void UserChangedEvent::set_allocated_userid(std::string* userid) {
// -------------------------------------------------------------------
// UserBadEvent
// string userID = 1;
inline void UserBadEvent::clear_userid() {
_impl_.userid_.ClearToEmpty();
}
inline const std::string& UserBadEvent::userid() const {
// @@protoc_insertion_point(field_get:grpc.UserBadEvent.userID)
return _internal_userid();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void UserBadEvent::set_userid(ArgT0&& arg0, ArgT... args) {
_impl_.userid_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:grpc.UserBadEvent.userID)
}
inline std::string* UserBadEvent::mutable_userid() {
std::string* _s = _internal_mutable_userid();
// @@protoc_insertion_point(field_mutable:grpc.UserBadEvent.userID)
return _s;
}
inline const std::string& UserBadEvent::_internal_userid() const {
return _impl_.userid_.Get();
}
inline void UserBadEvent::_internal_set_userid(const std::string& value) {
_impl_.userid_.Set(value, GetArenaForAllocation());
}
inline std::string* UserBadEvent::_internal_mutable_userid() {
return _impl_.userid_.Mutable(GetArenaForAllocation());
}
inline std::string* UserBadEvent::release_userid() {
// @@protoc_insertion_point(field_release:grpc.UserBadEvent.userID)
return _impl_.userid_.Release();
}
inline void UserBadEvent::set_allocated_userid(std::string* userid) {
if (userid != nullptr) {
} else {
}
_impl_.userid_.SetAllocated(userid, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.userid_.IsDefault()) {
_impl_.userid_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:grpc.UserBadEvent.userID)
}
// string errorMessage = 2;
inline void UserBadEvent::clear_errormessage() {
_impl_.errormessage_.ClearToEmpty();
}
inline const std::string& UserBadEvent::errormessage() const {
// @@protoc_insertion_point(field_get:grpc.UserBadEvent.errorMessage)
return _internal_errormessage();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void UserBadEvent::set_errormessage(ArgT0&& arg0, ArgT... args) {
_impl_.errormessage_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:grpc.UserBadEvent.errorMessage)
}
inline std::string* UserBadEvent::mutable_errormessage() {
std::string* _s = _internal_mutable_errormessage();
// @@protoc_insertion_point(field_mutable:grpc.UserBadEvent.errorMessage)
return _s;
}
inline const std::string& UserBadEvent::_internal_errormessage() const {
return _impl_.errormessage_.Get();
}
inline void UserBadEvent::_internal_set_errormessage(const std::string& value) {
_impl_.errormessage_.Set(value, GetArenaForAllocation());
}
inline std::string* UserBadEvent::_internal_mutable_errormessage() {
return _impl_.errormessage_.Mutable(GetArenaForAllocation());
}
inline std::string* UserBadEvent::release_errormessage() {
// @@protoc_insertion_point(field_release:grpc.UserBadEvent.errorMessage)
return _impl_.errormessage_.Release();
}
inline void UserBadEvent::set_allocated_errormessage(std::string* errormessage) {
if (errormessage != nullptr) {
} else {
}
_impl_.errormessage_.SetAllocated(errormessage, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.errormessage_.IsDefault()) {
_impl_.errormessage_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:grpc.UserBadEvent.errorMessage)
}
// -------------------------------------------------------------------
// GenericErrorEvent
// .grpc.ErrorCode code = 1;
@ -15591,6 +15964,8 @@ inline void GenericErrorEvent::set_code(::grpc::ErrorCode value) {
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)

View File

@ -295,6 +295,14 @@ func (f *frontendCLI) watchEvents(eventCh <-chan events.Event) { // nolint:funle
f.notifyLogout(user.Username)
case events.UserBadEvent:
user, err := f.bridge.GetUserInfo(event.UserID)
if err != nil {
return
}
f.Printf("User %s received a bad event and was logged out.\n", user.Username)
case events.UserAddressUpdated:
user, err := f.bridge.GetUserInfo(event.UserID)
if err != nil {

File diff suppressed because it is too large Load Diff

View File

@ -440,6 +440,7 @@ message UserEvent {
ToggleSplitModeFinishedEvent toggleSplitModeFinished= 1;
UserDisconnectedEvent userDisconnected = 2;
UserChangedEvent userChanged = 3;
UserBadEvent userBadEvent = 4;
}
}
@ -455,6 +456,11 @@ message UserChangedEvent {
string userID = 1;
}
message UserBadEvent {
string userID = 1;
string errorMessage = 2;
}
//**********************************************************
// Generic errors
//**********************************************************

View File

@ -173,6 +173,10 @@ func NewUserChangedEvent(userID string) *StreamEvent {
return userEvent(&UserEvent{Event: &UserEvent_UserChanged{UserChanged: &UserChangedEvent{UserID: userID}}})
}
func NewUserBadEvent(userID string, errorMessage string) *StreamEvent {
return userEvent(&UserEvent{Event: &UserEvent_UserBadEvent{UserBadEvent: &UserBadEvent{UserID: userID, ErrorMessage: errorMessage}}})
}
func NewGenericErrorEvent(errorCode ErrorCode) *StreamEvent {
return genericErrorEvent(&GenericErrorEvent{Code: errorCode})
}

View File

@ -313,11 +313,14 @@ func (s *Service) watchEvents() {
// This is the event the GUI cares about.
_ = s.SendEvent(NewUserChangedEvent(event.UserID))
// The GUI doesn't care about this event... not sure why we still emit it.
// The GUI doesn't care about this event... not sure why we still emit it. GODT-2128.
if user, err := s.bridge.GetUserInfo(event.UserID); err == nil {
_ = s.SendEvent(NewUserDisconnectedEvent(user.Username))
}
case events.UserBadEvent:
_ = s.SendEvent(NewUserBadEvent(event.UserID, event.Error.Error()))
case events.UpdateLatest:
safe.RLock(func() {
s.latest = event.Version