mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
feat(GODT-2748): log calls that cause main window to show, with reason.
This commit is contained in:
@ -33,7 +33,7 @@ using namespace bridgepp;
|
||||
/// \brief handle notification of attempt to re-open the application.
|
||||
//****************************************************************************************************************************************************
|
||||
void applicationShouldHandleReopen(id, SEL) {
|
||||
app().backend().showMainWindow();
|
||||
app().backend().showMainWindow("macOS applicationShouldHandleReopen notification");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -116,6 +116,46 @@ bool QMLBackend::isInternetOn() const {
|
||||
return isInternetOn_;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] reason The reason for the request.
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::showMainWindow(QString const&reason) {
|
||||
app().log().debug(QString("main window show requested: %1").arg(reason));
|
||||
emit showMainWindow();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] reason The reason for the request.
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::showHelp(QString const&reason) {
|
||||
app().log().debug(QString("main window show requested (help page): %1").arg(reason));
|
||||
emit showHelp();
|
||||
}
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] reason The reason for the request.
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::showSettings(QString const&reason) {
|
||||
app().log().debug(QString("main window show requested (settings page): %1").arg(reason));
|
||||
emit showSettings();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] userID The userID.
|
||||
/// \param[in] forceShowWindow Should the window be force to display.
|
||||
/// \param[in] reason The reason for the request.
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::selectUser(QString const &userID, bool forceShowWindow, QString const &reason) {
|
||||
if (forceShowWindow) {
|
||||
app().log().debug(QString("main window show requested (user page): %1").arg(reason));
|
||||
}
|
||||
emit selectUser(userID, forceShowWindow);
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The build year as a string (e.g. 2023)
|
||||
//****************************************************************************************************************************************************
|
||||
@ -1116,7 +1156,7 @@ void QMLBackend::connectGrpcEvents() {
|
||||
connect(client, &GRPCClient::reportBugFinished, this, &QMLBackend::reportBugFinished);
|
||||
connect(client, &GRPCClient::reportBugSuccess, this, &QMLBackend::bugReportSendSuccess);
|
||||
connect(client, &GRPCClient::reportBugError, this, &QMLBackend::bugReportSendError);
|
||||
connect(client, &GRPCClient::showMainWindow, this, &QMLBackend::showMainWindow);
|
||||
connect(client, &GRPCClient::showMainWindow, [&]() { this->showMainWindow("gRPC showMainWindow event"); });
|
||||
|
||||
// cache events
|
||||
connect(client, &GRPCClient::diskCacheUnavailable, this, &QMLBackend::diskCacheUnavailable);
|
||||
|
||||
@ -46,6 +46,10 @@ public: // member functions.
|
||||
bool waitForEventStreamReaderToFinish(qint32 timeoutMs); ///< Wait for the event stream reader to finish.
|
||||
UserList const& users() const; ///< Return the list of users
|
||||
bool isInternetOn() const; ///< Check if bridge considers internet as on.
|
||||
void showMainWindow(QString const &reason); ///< Show the main window.
|
||||
void showHelp(QString const &reason); ///< Show the help page.
|
||||
void showSettings(QString const &reason); ///< Show the settings page.
|
||||
void selectUser(QString const &userID, bool forceShowWindow, QString const &reason); ///< Select the user and display its account details (or login screen).
|
||||
|
||||
// invokable methods can be called from QML. They generally return a value, which slots cannot do.
|
||||
Q_INVOKABLE static QString buildYear(); ///< Return the application build year.
|
||||
|
||||
@ -34,7 +34,7 @@ QColor const warnColor(255, 153, 0); ///< The warn state color.
|
||||
QColor const updateColor(35, 158, 206); ///< The warn state color.
|
||||
QColor const greyColor(112, 109, 107); ///< The grey color.
|
||||
qint64 const iconRefreshTimerIntervalMs = 1000; ///< The interval for the refresh timer when switching DPI / screen config, in milliseconds.
|
||||
qint64 const iconRefreshDurationSecs = 10; ///< The total number of seconds during wich we periodically refresh the icon after a DPI change.
|
||||
qint64 const iconRefreshDurationSecs = 10; ///< The total number of seconds during which we periodically refresh the icon after a DPI change.
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
@ -184,10 +184,12 @@ TrayIcon::TrayIcon()
|
||||
this->setContextMenu(menu_.get());
|
||||
|
||||
connect(menu_.get(), &QMenu::aboutToShow, this, &TrayIcon::onMenuAboutToShow);
|
||||
connect(this, &TrayIcon::selectUser, &app().backend(), &QMLBackend::selectUser);
|
||||
connect(this, &TrayIcon::selectUser, &app().backend(), [](QString const& userID, bool forceShowWindow) {
|
||||
app().backend().selectUser(userID, forceShowWindow);
|
||||
});
|
||||
connect(this, &TrayIcon::activated, this, &TrayIcon::onActivated);
|
||||
// some OSes/Desktop managers will automatically show main window when clicked, but not all, so we do it manually.
|
||||
connect(this, &TrayIcon::messageClicked, &app().backend(), &QMLBackend::showMainWindow);
|
||||
connect(this, &TrayIcon::messageClicked, []() { app().backend().showMainWindow("tray icon popup notification clicked"); });
|
||||
this->show();
|
||||
|
||||
// TrayIcon does not expose its screen, so we connect relevant screen events to our DPI change handler.
|
||||
@ -226,7 +228,7 @@ void TrayIcon::onUserClicked() {
|
||||
throw Exception("Could not retrieve context menu's selected user.");
|
||||
}
|
||||
|
||||
emit selectUser(userID, true);
|
||||
app().backend().selectUser(userID, true, "tray menu user clicked");
|
||||
} catch (Exception const &e) {
|
||||
app().log().error(e.qwhat());
|
||||
}
|
||||
@ -238,7 +240,7 @@ void TrayIcon::onUserClicked() {
|
||||
//****************************************************************************************************************************************************
|
||||
void TrayIcon::onActivated(QSystemTrayIcon::ActivationReason reason) {
|
||||
if ((QSystemTrayIcon::Trigger == reason) && !onMacOS()) {
|
||||
app().backend().showMainWindow();
|
||||
app().backend().showMainWindow("tray icon activated");
|
||||
}
|
||||
}
|
||||
|
||||
@ -346,7 +348,7 @@ void TrayIcon::refreshContextMenu() {
|
||||
|
||||
bool const internetOn = app().backend().isInternetOn();
|
||||
menu_->clear();
|
||||
menu_->addAction(statusIcon_, stateString_, &app().backend(), &QMLBackend::showMainWindow);
|
||||
menu_->addAction(statusIcon_, stateString_, []() {app().backend().showMainWindow("tray menu status clicked");});
|
||||
menu_->addSeparator();
|
||||
QKeySequence noShortcut;
|
||||
UserList const &users = app().backend().users();
|
||||
@ -370,11 +372,15 @@ void TrayIcon::refreshContextMenu() {
|
||||
menu_->addSeparator();
|
||||
}
|
||||
|
||||
menu_->addAction(tr("&Open Bridge"), onMac ? QKeySequence("Ctrl+O") : noShortcut, &app().backend(), &QMLBackend::showMainWindow);
|
||||
menu_->addAction(tr("&Help"), onMac ? QKeySequence("Ctrl+F1") : noShortcut, &app().backend(), &QMLBackend::showHelp);
|
||||
menu_->addAction(tr("&Settings"), onMac ? QKeySequence("Ctrl+,") : noShortcut, &app().backend(), &QMLBackend::showSettings);
|
||||
menu_->addAction(tr("&Open Bridge"), onMac ? QKeySequence("Ctrl+O") : noShortcut, []() {
|
||||
app().backend().showMainWindow("tray menu 'open bridge' clicked");
|
||||
});
|
||||
menu_->addAction(tr("&Help"), onMac ? QKeySequence("Ctrl+F1") : noShortcut, []() {
|
||||
app().backend().showHelp("tray menu 'Help' clicked");
|
||||
});
|
||||
menu_->addAction(tr("&Settings"), onMac ? QKeySequence("Ctrl+,") : noShortcut, []() {
|
||||
app().backend().showHelp("tray menu 'Settings' clicked");
|
||||
});
|
||||
menu_->addSeparator();
|
||||
menu_->addAction(tr("&Quit Bridge"), onMac ? QKeySequence("Ctrl+Q") : noShortcut, &app().backend(), &QMLBackend::quit);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -213,7 +213,7 @@ void focusOtherInstance() {
|
||||
if (!client.connectToServer(5000, sc.port, &error)) {
|
||||
throw Exception("Could not connect to bridge focus service for a raise call.", error);
|
||||
}
|
||||
if (!client.raise().ok()) {
|
||||
if (!client.raise("focusOtherInstance").ok()) {
|
||||
throw Exception(QString("The raise call to the bridge focus service failed."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,12 +113,15 @@ bool FocusGRPCClient::connectToServer(qint64 timeoutMs, quint16 port, QString *o
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] reason The reason behind the raise call.
|
||||
/// \return The status for the call.
|
||||
//****************************************************************************************************************************************************
|
||||
grpc::Status FocusGRPCClient::raise() {
|
||||
grpc::Status FocusGRPCClient::raise(QString const &reason) {
|
||||
log_.debug("FocusGRPCService::raise()");
|
||||
ClientContext ctx;
|
||||
return stub_->Raise(&ctx, empty, &empty);
|
||||
StringValue s;
|
||||
s.set_value(reason.toStdString());
|
||||
return stub_->Raise(&ctx, s, &empty);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ public: // member functions.
|
||||
FocusGRPCClient &operator=(FocusGRPCClient &&) = delete; ///< Disabled move assignment operator.
|
||||
|
||||
bool connectToServer(qint64 timeoutMs, quint16 port, QString *outError = nullptr); ///< Connect to the focus server
|
||||
grpc::Status raise(); ///< Performs the 'raise' call.
|
||||
grpc::Status raise(QString const &reason); ///< Performs the 'raise' call.
|
||||
grpc::Status version(QString &outVersion); ///< Performs the 'version' call.
|
||||
|
||||
private:
|
||||
|
||||
@ -37,23 +37,23 @@ Focus::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, con
|
||||
, rpcmethod_Version_(Focus_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
{}
|
||||
|
||||
::grpc::Status Focus::Stub::Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Empty* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Raise_, context, request, response);
|
||||
::grpc::Status Focus::Stub::Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Raise_, context, request, response);
|
||||
}
|
||||
|
||||
void Focus::Stub::async::Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc::internal::CallbackUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Raise_, context, request, response, std::move(f));
|
||||
void Focus::Stub::async::Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc::internal::CallbackUnaryCall< ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Raise_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void Focus::Stub::async::Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) {
|
||||
void Focus::Stub::async::Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) {
|
||||
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Raise_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Focus::Stub::PrepareAsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Raise_, context, request);
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Focus::Stub::PrepareAsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::google::protobuf::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Raise_, context, request);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Focus::Stub::AsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Focus::Stub::AsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) {
|
||||
auto* result =
|
||||
this->PrepareAsyncRaiseRaw(context, request, cq);
|
||||
result->StartCall();
|
||||
@ -87,10 +87,10 @@ Focus::Service::Service() {
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
Focus_method_names[0],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< Focus::Service, ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
new ::grpc::internal::RpcMethodHandler< Focus::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
[](Focus::Service* service,
|
||||
::grpc::ServerContext* ctx,
|
||||
const ::google::protobuf::Empty* req,
|
||||
const ::google::protobuf::StringValue* req,
|
||||
::google::protobuf::Empty* resp) {
|
||||
return service->Raise(ctx, req, resp);
|
||||
}, this)));
|
||||
@ -109,7 +109,7 @@ Focus::Service::Service() {
|
||||
Focus::Service::~Service() {
|
||||
}
|
||||
|
||||
::grpc::Status Focus::Service::Raise(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response) {
|
||||
::grpc::Status Focus::Service::Raise(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
||||
@ -56,11 +56,11 @@ class Focus final {
|
||||
class StubInterface {
|
||||
public:
|
||||
virtual ~StubInterface() {}
|
||||
virtual ::grpc::Status Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Empty* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> AsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
virtual ::grpc::Status Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> AsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(AsyncRaiseRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> PrepareAsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> PrepareAsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(PrepareAsyncRaiseRaw(context, request, cq));
|
||||
}
|
||||
virtual ::grpc::Status Version(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::focus::VersionResponse* response) = 0;
|
||||
@ -73,8 +73,8 @@ class Focus final {
|
||||
class async_interface {
|
||||
public:
|
||||
virtual ~async_interface() {}
|
||||
virtual void Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0;
|
||||
virtual void Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0;
|
||||
virtual void Version(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::focus::VersionResponse* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void Version(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::focus::VersionResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0;
|
||||
};
|
||||
@ -82,19 +82,19 @@ class Focus final {
|
||||
virtual class async_interface* async() { return nullptr; }
|
||||
class async_interface* experimental_async() { return async(); }
|
||||
private:
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* AsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* AsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::focus::VersionResponse>* AsyncVersionRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::focus::VersionResponse>* PrepareAsyncVersionRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
};
|
||||
class Stub final : public StubInterface {
|
||||
public:
|
||||
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
|
||||
::grpc::Status Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Empty* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> AsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::Status Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> AsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(AsyncRaiseRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> PrepareAsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> PrepareAsyncRaise(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(PrepareAsyncRaiseRaw(context, request, cq));
|
||||
}
|
||||
::grpc::Status Version(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::focus::VersionResponse* response) override;
|
||||
@ -107,8 +107,8 @@ class Focus final {
|
||||
class async final :
|
||||
public StubInterface::async_interface {
|
||||
public:
|
||||
void Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)>) override;
|
||||
void Raise(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override;
|
||||
void Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function<void(::grpc::Status)>) override;
|
||||
void Raise(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override;
|
||||
void Version(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::focus::VersionResponse* response, std::function<void(::grpc::Status)>) override;
|
||||
void Version(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::focus::VersionResponse* response, ::grpc::ClientUnaryReactor* reactor) override;
|
||||
private:
|
||||
@ -122,8 +122,8 @@ class Focus final {
|
||||
private:
|
||||
std::shared_ptr< ::grpc::ChannelInterface> channel_;
|
||||
class async async_stub_{this};
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* AsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* AsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncRaiseRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::focus::VersionResponse>* AsyncVersionRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::focus::VersionResponse>* PrepareAsyncVersionRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) override;
|
||||
const ::grpc::internal::RpcMethod rpcmethod_Raise_;
|
||||
@ -135,7 +135,7 @@ class Focus final {
|
||||
public:
|
||||
Service();
|
||||
virtual ~Service();
|
||||
virtual ::grpc::Status Raise(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response);
|
||||
virtual ::grpc::Status Raise(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response);
|
||||
virtual ::grpc::Status Version(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::focus::VersionResponse* response);
|
||||
};
|
||||
template <class BaseClass>
|
||||
@ -150,11 +150,11 @@ class Focus final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
void RequestRaise(::grpc::ServerContext* context, ::google::protobuf::Empty* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
||||
void RequestRaise(::grpc::ServerContext* context, ::google::protobuf::StringValue* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
||||
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
|
||||
}
|
||||
};
|
||||
@ -186,25 +186,25 @@ class Focus final {
|
||||
public:
|
||||
WithCallbackMethod_Raise() {
|
||||
::grpc::Service::MarkMethodCallback(0,
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::google::protobuf::Empty, ::google::protobuf::Empty>(
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::google::protobuf::StringValue, ::google::protobuf::Empty>(
|
||||
[this](
|
||||
::grpc::CallbackServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response) { return this->Raise(context, request, response); }));}
|
||||
::grpc::CallbackServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response) { return this->Raise(context, request, response); }));}
|
||||
void SetMessageAllocatorFor_Raise(
|
||||
::grpc::MessageAllocator< ::google::protobuf::Empty, ::google::protobuf::Empty>* allocator) {
|
||||
::grpc::MessageAllocator< ::google::protobuf::StringValue, ::google::protobuf::Empty>* allocator) {
|
||||
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0);
|
||||
static_cast<::grpc::internal::CallbackUnaryHandler< ::google::protobuf::Empty, ::google::protobuf::Empty>*>(handler)
|
||||
static_cast<::grpc::internal::CallbackUnaryHandler< ::google::protobuf::StringValue, ::google::protobuf::Empty>*>(handler)
|
||||
->SetMessageAllocator(allocator);
|
||||
}
|
||||
~WithCallbackMethod_Raise() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
virtual ::grpc::ServerUnaryReactor* Raise(
|
||||
::grpc::CallbackServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; }
|
||||
::grpc::CallbackServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; }
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithCallbackMethod_Version : public BaseClass {
|
||||
@ -247,7 +247,7 @@ class Focus final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -281,7 +281,7 @@ class Focus final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -324,7 +324,7 @@ class Focus final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -361,10 +361,10 @@ class Focus final {
|
||||
WithStreamedUnaryMethod_Raise() {
|
||||
::grpc::Service::MarkMethodStreamed(0,
|
||||
new ::grpc::internal::StreamedUnaryHandler<
|
||||
::google::protobuf::Empty, ::google::protobuf::Empty>(
|
||||
::google::protobuf::StringValue, ::google::protobuf::Empty>(
|
||||
[this](::grpc::ServerContext* context,
|
||||
::grpc::ServerUnaryStreamer<
|
||||
::google::protobuf::Empty, ::google::protobuf::Empty>* streamer) {
|
||||
::google::protobuf::StringValue, ::google::protobuf::Empty>* streamer) {
|
||||
return this->StreamedRaise(context,
|
||||
streamer);
|
||||
}));
|
||||
@ -373,12 +373,12 @@ class Focus final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable regular version of this method
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
::grpc::Status Raise(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
// replace default version of method with streamed unary
|
||||
virtual ::grpc::Status StreamedRaise(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::google::protobuf::Empty,::google::protobuf::Empty>* server_unary_streamer) = 0;
|
||||
virtual ::grpc::Status StreamedRaise(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::google::protobuf::StringValue,::google::protobuf::Empty>* server_unary_streamer) = 0;
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_Version : public BaseClass {
|
||||
|
||||
@ -58,22 +58,23 @@ static const ::_pb::Message* const file_default_instances[] = {
|
||||
|
||||
const char descriptor_table_protodef_focus_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
|
||||
"\n\013focus.proto\022\005focus\032\033google/protobuf/em"
|
||||
"pty.proto\"\"\n\017VersionResponse\022\017\n\007version\030"
|
||||
"\001 \001(\t2{\n\005Focus\0227\n\005Raise\022\026.google.protobu"
|
||||
"f.Empty\032\026.google.protobuf.Empty\0229\n\007Versi"
|
||||
"on\022\026.google.protobuf.Empty\032\026.focus.Versi"
|
||||
"onResponseB=Z;github.com/ProtonMail/prot"
|
||||
"on-bridge/v3/internal/focus/protob\006proto"
|
||||
"3"
|
||||
"pty.proto\032\036google/protobuf/wrappers.prot"
|
||||
"o\"\"\n\017VersionResponse\022\017\n\007version\030\001 \001(\t2\201\001"
|
||||
"\n\005Focus\022=\n\005Raise\022\034.google.protobuf.Strin"
|
||||
"gValue\032\026.google.protobuf.Empty\0229\n\007Versio"
|
||||
"n\022\026.google.protobuf.Empty\032\026.focus.Versio"
|
||||
"nResponseB=Z;github.com/ProtonMail/proto"
|
||||
"n-bridge/v3/internal/focus/protob\006proto3"
|
||||
;
|
||||
static const ::_pbi::DescriptorTable* const descriptor_table_focus_2eproto_deps[1] = {
|
||||
static const ::_pbi::DescriptorTable* const descriptor_table_focus_2eproto_deps[2] = {
|
||||
&::descriptor_table_google_2fprotobuf_2fempty_2eproto,
|
||||
&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto,
|
||||
};
|
||||
static ::_pbi::once_flag descriptor_table_focus_2eproto_once;
|
||||
const ::_pbi::DescriptorTable descriptor_table_focus_2eproto = {
|
||||
false, false, 281, descriptor_table_protodef_focus_2eproto,
|
||||
false, false, 320, descriptor_table_protodef_focus_2eproto,
|
||||
"focus.proto",
|
||||
&descriptor_table_focus_2eproto_once, descriptor_table_focus_2eproto_deps, 1, 1,
|
||||
&descriptor_table_focus_2eproto_once, descriptor_table_focus_2eproto_deps, 2, 1,
|
||||
schemas, file_default_instances, TableStruct_focus_2eproto::offsets,
|
||||
file_level_metadata_focus_2eproto, file_level_enum_descriptors_focus_2eproto,
|
||||
file_level_service_descriptors_focus_2eproto,
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include <google/protobuf/extension_set.h> // IWYU pragma: export
|
||||
#include <google/protobuf/unknown_field_set.h>
|
||||
#include <google/protobuf/empty.pb.h>
|
||||
#include <google/protobuf/wrappers.pb.h>
|
||||
// @@protoc_insertion_point(includes)
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#define PROTOBUF_INTERNAL_EXPORT_focus_2eproto
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.21.3
|
||||
// protoc v3.21.12
|
||||
// source: bridge.proto
|
||||
|
||||
package grpc
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.21.3
|
||||
// - protoc v3.21.12
|
||||
// source: bridge.proto
|
||||
|
||||
package grpc
|
||||
|
||||
Reference in New Issue
Block a user