diff --git a/internal/bridge/config_status.go b/internal/bridge/config_status.go index a51fada2..faf63f49 100644 --- a/internal/bridge/config_status.go +++ b/internal/bridge/config_status.go @@ -37,10 +37,10 @@ func (bridge *Bridge) AutoconfigUsed(client string) { }, bridge.usersLock) } -func (bridge *Bridge) KBArticleOpened(article string) { +func (bridge *Bridge) ExternalLinkClicked(article string) { safe.RLock(func() { for _, user := range bridge.users { - user.KBArticleOpened(article) + user.ExternalLinkClicked(article) } }, bridge.usersLock) } diff --git a/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp b/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp index d848c88d..8813789d 100644 --- a/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp +++ b/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp @@ -817,7 +817,7 @@ Status GRPCService::InstallTLSCertificate(ServerContext *, Empty const *, Empty //**************************************************************************************************************************************************** /// \param[in] request The request. //**************************************************************************************************************************************************** -Status GRPCService::KBArticleClicked(::grpc::ServerContext *, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) { +Status GRPCService::ExternalLinkClicked(::grpc::ServerContext *, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) { app().log().debug(QString("%1 - URL = %2").arg(__FUNCTION__, QString::fromStdString(request->value()))); return Status::OK; } diff --git a/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.h b/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.h index fe7ec6ab..0e668a80 100644 --- a/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.h +++ b/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.h @@ -98,7 +98,7 @@ public: // member functions. grpc::Status ExportTLSCertificates(::grpc::ServerContext *, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) override; grpc::Status ReportBugClicked(::grpc::ServerContext *context, ::google::protobuf::Empty const *request, ::google::protobuf::Empty *) override; grpc::Status AutoconfigClicked(::grpc::ServerContext *context, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) override; - grpc::Status KBArticleClicked(::grpc::ServerContext *, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) override; + grpc::Status ExternalLinkClicked(::grpc::ServerContext *, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) override; grpc::Status RunEventStream(::grpc::ServerContext *ctx, ::grpc::EventStreamRequest const *request, ::grpc::ServerWriter<::grpc::StreamEvent> *writer) override; grpc::Status StopEventStream(::grpc::ServerContext *, ::google::protobuf::Empty const *, ::google::protobuf::Empty *) override; bool sendEvent(bridgepp::SPStreamEvent const &event); ///< Queue an event for sending through the event stream. diff --git a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp index 94e33c3b..493178fb 100644 --- a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp +++ b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp @@ -294,11 +294,11 @@ bool QMLBackend::isTLSCertificateInstalled() { //**************************************************************************************************************************************************** /// \param[in] url The URL of the knowledge base article. If empty/invalid, the home page for the Bridge knowledge base is opened. //**************************************************************************************************************************************************** -void QMLBackend::openKBArticle(QString const &url) { +void QMLBackend::openExternalLink(QString const &url) { HANDLE_EXCEPTION( QString const u = url.isEmpty() ? bridgeKBUrl : url; QDesktopServices::openUrl(u); - emit notifyKBArticleClicked(u); + emit notifyExternalLinkClicked(u); ) } @@ -1062,9 +1062,9 @@ void QMLBackend::notifyAutoconfigClicked(QString const &client) const { //**************************************************************************************************************************************************** /// \param[in] article The url of the KB article. //**************************************************************************************************************************************************** -void QMLBackend::notifyKBArticleClicked(QString const &article) const { +void QMLBackend::notifyExternalLinkClicked(QString const &article) const { HANDLE_EXCEPTION( - app().grpc().KBArticleClicked(article); + app().grpc().externalLinkClicked(article); ) } diff --git a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h index a19b79b8..c295ede2 100644 --- a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h +++ b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h @@ -65,7 +65,7 @@ public: // member functions. Q_INVOKABLE QString collectAnswers(quint8 categoryId) const; ///< Collect answer for a given set of questions. Q_INVOKABLE void clearAnswers(); ///< Clear all collected answers. Q_INVOKABLE bool isTLSCertificateInstalled(); ///< Check if the bridge certificate is installed in the OS keychain. - Q_INVOKABLE void openKBArticle(QString const & url = QString()); ///< Open a knowledge base article. + Q_INVOKABLE void openExternalLink(QString const & url = QString()); ///< Open a knowledge base article. public: // Qt/QML properties. Note that the NOTIFY-er signal is required even for read-only properties (QML warning otherwise) Q_PROPERTY(bool showOnStartup READ showOnStartup NOTIFY showOnStartupChanged) @@ -205,7 +205,7 @@ public slots: // slot for signals received from QML -> To be forwarded to Bridge void sendBadEventUserFeedback(QString const &userID, bool doResync); ///< Slot the providing user feedback for a bad event. void notifyReportBugClicked() const; ///< Slot for the ReportBugClicked gRPC event. void notifyAutoconfigClicked(QString const &client) const; ///< Slot for gAutoconfigClicked gRPC event. - void notifyKBArticleClicked(QString const &article) const; ///< Slot for KBArticleClicked gRPC event. + void notifyExternalLinkClicked(QString const &article) const; ///< Slot for KBArticleClicked gRPC event. public slots: // slots for functions that need to be processed locally. void setNormalTrayIcon(); ///< Set the tray icon to normal. diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/BugReportView.qml b/internal/frontend/bridge-gui/bridge-gui/qml/BugReportView.qml index 447ad61d..e5029ecd 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/BugReportView.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/BugReportView.qml @@ -113,7 +113,7 @@ SettingsView { secondary: true text: qsTr("View logs") - onClicked: Qt.openUrlExternally(Backend.logsPath) + onClicked: Backend.openExternalLink(Backend.logsPath) } } TextEdit { diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml b/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml index 3f2199b1..66d0f0fc 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml @@ -36,7 +36,7 @@ SettingsView { type: SettingsItem.PrimaryButton onClicked: { - Backend.openKBArticle(); + Backend.openExternalLink(); } } SettingsItem { @@ -70,7 +70,7 @@ SettingsView { text: qsTr("Logs") type: SettingsItem.Button - onClicked: Qt.openUrlExternally(Backend.logsPath) + onClicked: Backend.openExternalLink(Backend.logsPath) } SettingsItem { id: reportBug @@ -103,7 +103,7 @@ SettingsView { type: Label.Caption onLinkActivated: function (link) { - Qt.openUrlExternally(link) + Backend.openExternalLink(link) } } } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/NotificationDialog.qml b/internal/frontend/bridge-gui/bridge-gui/qml/NotificationDialog.qml index 9cb8f421..f7387bf4 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/NotificationDialog.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/NotificationDialog.qml @@ -71,7 +71,7 @@ Dialog { wrapMode: Text.WordWrap onLinkActivated: function (link) { - Qt.openUrlExternally(link); + Backend.openExternalLink(link); } } Item { diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml b/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml index 78d1ba20..86676f1d 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml @@ -673,7 +673,7 @@ QtObject { text: qsTr("Upgrade") onTriggered: { - Qt.openUrlExternally(root.onlyPaidUsers.pricingLink); + Backend.openExternalLink(root.onlyPaidUsers.pricingLink); root.onlyPaidUsers.active = false; } } @@ -700,7 +700,7 @@ QtObject { text: qsTr("Open the support page") onTriggered: { - Backend.openKBArticle(); + Backend.openExternalLink(); Backend.quit(); } } @@ -841,7 +841,7 @@ QtObject { text: qsTr("Update manually") onTriggered: { - Qt.openUrlExternally(Backend.landingPageLink); + Backend.openExternalLink(Backend.landingPageLink); root.updateForce.active = false; } }, @@ -881,7 +881,7 @@ QtObject { text: qsTr("Update manually") onTriggered: { - Qt.openUrlExternally(Backend.landingPageLink); + Backend.openExternalLink(Backend.landingPageLink); root.updateForceError.active = false; } }, @@ -941,7 +941,7 @@ QtObject { text: qsTr("Update manually") onTriggered: { - Qt.openUrlExternally(Backend.landingPageLink); + Backend.openExternalLink(Backend.landingPageLink); root.updateManualError.active = false; Backend.quit(); } @@ -991,7 +991,7 @@ QtObject { text: qsTr("Update manually") onTriggered: { - Qt.openUrlExternally(Backend.landingPageLink); + Backend.openExternalLink(Backend.landingPageLink); root.updateManualReady.active = false; } }, @@ -1052,7 +1052,7 @@ QtObject { text: qsTr("Update manually") onTriggered: { - Qt.openUrlExternally(Backend.landingPageLink); + Backend.openExternalLink(Backend.landingPageLink); root.updateSilentError.active = false; } } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml index a1a6f8ee..95755fef 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml @@ -55,7 +55,7 @@ RowLayout { type: Label.LabelType.Body onLinkActivated: function (link) { if ((link !== "#") && (link.length > 0)) { - Qt.openUrlExternally(link); + Backend.openExternalLink(link); } if (callback) { callback(); diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml index 924c4f1a..b8a0e7f6 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml @@ -79,7 +79,7 @@ Rectangle { text: qsTr("Open guide") onClicked: function () { - Backend.openKBArticle(wizard.setupGuideLink()); + Backend.openExternalLink(wizard.setupGuideLink()); } } } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml index 8040793b..59fb5eae 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml @@ -49,7 +49,7 @@ Button { text: qsTr("Get help") onClicked: { - Backend.openKBArticle(); + Backend.openExternalLink(); } } MenuItem { diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml index c4726a5b..69dabef0 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml @@ -37,7 +37,7 @@ Item { function showAppleMailAutoconfigCertificateInstall() { showAppleMailAutoconfigCommon(); descriptionLabel.text = qsTr("Apple Mail configuration is mostly automated, but in order to work, Bridge needs to install a certificate in your keychain."); - linkLabel1.setCallback(function() { Backend.openKBArticle("https://proton.me/support/apple-mail-certificate"); }, qsTr("Why is this certificate needed?"), true); + linkLabel1.setCallback(function() { Backend.openExternalLink("https://proton.me/support/apple-mail-certificate"); }, qsTr("Why is this certificate needed?"), true); linkLabel2.clear(); } function showAppleMailAutoconfigCommon() { @@ -51,7 +51,7 @@ Item { function showAppleMailAutoconfigProfileInstall() { showAppleMailAutoconfigCommon(); descriptionLabel.text = qsTr("The final step before you can start using Apple Mail is to install the Bridge server profile in the system preferences.\n\nAdding a server profile is necessary to ensure that your Mac can receive and send Proton Mails."); - linkLabel1.setCallback(function() { Backend.openKBArticle("https://proton.me/support/macos-certificate-warning"); }, qsTr("Why is there a yellow warning sign?"), true); + linkLabel1.setCallback(function() { Backend.openExternalLink("https://proton.me/support/macos-certificate-warning"); }, qsTr("Why is there a yellow warning sign?"), true); linkLabel2.setCallback(wizard.showClientParams, qsTr("Configure Apple Mail manually"), false); } function showClientSelector(newAccount = true) { @@ -86,7 +86,7 @@ Item { function showOnboarding() { titleLabel.text = (Backend.users.count === 0) ? welcomeTitle : addAccountTitle; descriptionLabel.text = welcomeDescription - linkLabel1.setCallback(function() { Backend.openKBArticle("https://proton.me/support/why-you-need-bridge"); }, qsTr("Why do I need Bridge?"), true); + linkLabel1.setCallback(function() { Backend.openExternalLink("https://proton.me/support/why-you-need-bridge"); }, qsTr("Why do I need Bridge?"), true); linkLabel2.clear(); root.iconSource = welcomeImage; root.iconHeight = welcomeImageHeight; diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SplashScreen.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SplashScreen.qml index 753f5d25..58321487 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SplashScreen.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SplashScreen.qml @@ -162,7 +162,7 @@ Dialog { wrapMode: Text.WordWrap onLinkActivated: function (link) { - Qt.openUrlExternally(link); + Backend.openExternalLink(link); } } } diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp index 44013138..e1501dbc 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp @@ -1513,24 +1513,30 @@ UPClientContext GRPCClient::clientContext() const { } //**************************************************************************************************************************************************** -/// \param[in] userID The user ID. -/// \param[in] address The email address. /// \return the status for the gRPC call. //**************************************************************************************************************************************************** grpc::Status GRPCClient::reportBugClicked() { return this->logGRPCCallStatus(stub_->ReportBugClicked(this->clientContext().get(), empty, &empty), __FUNCTION__); } +//**************************************************************************************************************************************************** +/// \param[in] client The client string. +/// \return the status for the gRPC call. +//**************************************************************************************************************************************************** grpc::Status GRPCClient::autoconfigClicked(QString const &client) { StringValue s; s.set_value(client.toStdString()); return this->logGRPCCallStatus(stub_->AutoconfigClicked(this->clientContext().get(), s, &empty), __FUNCTION__); } -grpc::Status GRPCClient::KBArticleClicked(QString const &article) { +//**************************************************************************************************************************************************** +/// \param[in] link The clicked link. +/// \return the status for the gRPC call. +//**************************************************************************************************************************************************** +grpc::Status GRPCClient::externalLinkClicked(QString const &link) { StringValue s; - s.set_value(article.toStdString()); - return this->logGRPCCallStatus(stub_->KBArticleClicked(this->clientContext().get(), s, &empty), __FUNCTION__); + s.set_value(link.toStdString()); + return this->logGRPCCallStatus(stub_->ExternalLinkClicked(this->clientContext().get(), s, &empty), __FUNCTION__); } diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h index bf17733f..c55590ea 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h @@ -194,7 +194,7 @@ signals: public: // telemetry related calls grpc::Status reportBugClicked(); ///< Performs the 'reportBugClicked' call. grpc::Status autoconfigClicked(QString const &userID); ///< Performs the 'AutoconfigClicked' call. - grpc::Status KBArticleClicked(QString const &userID); ///< Performs the 'KBArticleClicked' call. + grpc::Status externalLinkClicked(QString const &userID); ///< Performs the 'KBArticleClicked' call. public: // keychain related calls grpc::Status availableKeychains(QStringList &outKeychains); diff --git a/internal/frontend/grpc/bridge.pb.go b/internal/frontend/grpc/bridge.pb.go index a4f12158..3a96aabb 100644 --- a/internal/frontend/grpc/bridge.pb.go +++ b/internal/frontend/grpc/bridge.pb.go @@ -4996,7 +4996,7 @@ var file_bridge_proto_rawDesc = []byte{ 0x4f, 0x52, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x4c, 0x53, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x5f, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x58, 0x50, 0x4f, 0x52, - 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0xfc, 0x21, 0x0a, 0x06, 0x42, 0x72, + 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0xff, 0x21, 0x0a, 0x06, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, @@ -5241,38 +5241,38 @@ var file_bridge_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x12, 0x48, 0x0a, 0x10, 0x4b, 0x42, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x43, 0x6c, - 0x69, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, 0x0a, 0x19, 0x49, - 0x73, 0x54, 0x4c, 0x53, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x47, 0x0a, 0x15, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x54, 0x4c, 0x53, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4d, 0x0a, 0x15, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, - 0x4c, 0x53, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x79, 0x12, 0x4b, 0x0a, 0x13, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, + 0x6b, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, + 0x0a, 0x19, 0x49, 0x73, 0x54, 0x4c, 0x53, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x47, 0x0a, 0x15, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x54, 0x4c, 0x53, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x36, 0x5a, 0x34, 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, 0x33, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4d, 0x0a, 0x15, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x54, 0x4c, 0x53, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x36, 0x5a, 0x34, 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, 0x33, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5489,7 +5489,7 @@ var file_bridge_proto_depIdxs = []int32{ 18, // 116: grpc.Bridge.ConfigureUserAppleMail:input_type -> grpc.ConfigureAppleMailRequest 75, // 117: grpc.Bridge.ReportBugClicked:input_type -> google.protobuf.Empty 74, // 118: grpc.Bridge.AutoconfigClicked:input_type -> google.protobuf.StringValue - 74, // 119: grpc.Bridge.KBArticleClicked:input_type -> google.protobuf.StringValue + 74, // 119: grpc.Bridge.ExternalLinkClicked:input_type -> google.protobuf.StringValue 75, // 120: grpc.Bridge.IsTLSCertificateInstalled:input_type -> google.protobuf.Empty 75, // 121: grpc.Bridge.InstallTLSCertificate:input_type -> google.protobuf.Empty 74, // 122: grpc.Bridge.ExportTLSCertificates:input_type -> google.protobuf.StringValue @@ -5551,7 +5551,7 @@ var file_bridge_proto_depIdxs = []int32{ 75, // 178: grpc.Bridge.ConfigureUserAppleMail:output_type -> google.protobuf.Empty 75, // 179: grpc.Bridge.ReportBugClicked:output_type -> google.protobuf.Empty 75, // 180: grpc.Bridge.AutoconfigClicked:output_type -> google.protobuf.Empty - 75, // 181: grpc.Bridge.KBArticleClicked:output_type -> google.protobuf.Empty + 75, // 181: grpc.Bridge.ExternalLinkClicked:output_type -> google.protobuf.Empty 76, // 182: grpc.Bridge.IsTLSCertificateInstalled:output_type -> google.protobuf.BoolValue 75, // 183: grpc.Bridge.InstallTLSCertificate:output_type -> google.protobuf.Empty 75, // 184: grpc.Bridge.ExportTLSCertificates:output_type -> google.protobuf.Empty diff --git a/internal/frontend/grpc/bridge.proto b/internal/frontend/grpc/bridge.proto index 204ae681..59c0eaf1 100644 --- a/internal/frontend/grpc/bridge.proto +++ b/internal/frontend/grpc/bridge.proto @@ -100,7 +100,7 @@ service Bridge { // Telemetry rpc ReportBugClicked(google.protobuf.Empty) returns (google.protobuf.Empty); rpc AutoconfigClicked(google.protobuf.StringValue) returns (google.protobuf.Empty); - rpc KBArticleClicked(google.protobuf.StringValue) returns (google.protobuf.Empty); + rpc ExternalLinkClicked(google.protobuf.StringValue) returns (google.protobuf.Empty); // TLS certificate related calls rpc IsTLSCertificateInstalled(google.protobuf.Empty) returns (google.protobuf.BoolValue); diff --git a/internal/frontend/grpc/bridge_grpc.pb.go b/internal/frontend/grpc/bridge_grpc.pb.go index cb59391d..01bc2ff4 100644 --- a/internal/frontend/grpc/bridge_grpc.pb.go +++ b/internal/frontend/grpc/bridge_grpc.pb.go @@ -94,7 +94,7 @@ const ( Bridge_ConfigureUserAppleMail_FullMethodName = "/grpc.Bridge/ConfigureUserAppleMail" Bridge_ReportBugClicked_FullMethodName = "/grpc.Bridge/ReportBugClicked" Bridge_AutoconfigClicked_FullMethodName = "/grpc.Bridge/AutoconfigClicked" - Bridge_KBArticleClicked_FullMethodName = "/grpc.Bridge/KBArticleClicked" + Bridge_ExternalLinkClicked_FullMethodName = "/grpc.Bridge/ExternalLinkClicked" Bridge_IsTLSCertificateInstalled_FullMethodName = "/grpc.Bridge/IsTLSCertificateInstalled" Bridge_InstallTLSCertificate_FullMethodName = "/grpc.Bridge/InstallTLSCertificate" Bridge_ExportTLSCertificates_FullMethodName = "/grpc.Bridge/ExportTLSCertificates" @@ -170,7 +170,7 @@ type BridgeClient interface { // Telemetry ReportBugClicked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) AutoconfigClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) - KBArticleClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) + ExternalLinkClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) // TLS certificate related calls IsTLSCertificateInstalled(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) InstallTLSCertificate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -692,9 +692,9 @@ func (c *bridgeClient) AutoconfigClicked(ctx context.Context, in *wrapperspb.Str return out, nil } -func (c *bridgeClient) KBArticleClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *bridgeClient) ExternalLinkClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Bridge_KBArticleClicked_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Bridge_ExternalLinkClicked_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -837,7 +837,7 @@ type BridgeServer interface { // Telemetry ReportBugClicked(context.Context, *emptypb.Empty) (*emptypb.Empty, error) AutoconfigClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) - KBArticleClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) + ExternalLinkClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) // TLS certificate related calls IsTLSCertificateInstalled(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) InstallTLSCertificate(context.Context, *emptypb.Empty) (*emptypb.Empty, error) @@ -1020,8 +1020,8 @@ func (UnimplementedBridgeServer) ReportBugClicked(context.Context, *emptypb.Empt func (UnimplementedBridgeServer) AutoconfigClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method AutoconfigClicked not implemented") } -func (UnimplementedBridgeServer) KBArticleClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method KBArticleClicked not implemented") +func (UnimplementedBridgeServer) ExternalLinkClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExternalLinkClicked not implemented") } func (UnimplementedBridgeServer) IsTLSCertificateInstalled(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) { return nil, status.Errorf(codes.Unimplemented, "method IsTLSCertificateInstalled not implemented") @@ -2059,20 +2059,20 @@ func _Bridge_AutoconfigClicked_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Bridge_KBArticleClicked_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Bridge_ExternalLinkClicked_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(wrapperspb.StringValue) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BridgeServer).KBArticleClicked(ctx, in) + return srv.(BridgeServer).ExternalLinkClicked(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Bridge_KBArticleClicked_FullMethodName, + FullMethod: Bridge_ExternalLinkClicked_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BridgeServer).KBArticleClicked(ctx, req.(*wrapperspb.StringValue)) + return srv.(BridgeServer).ExternalLinkClicked(ctx, req.(*wrapperspb.StringValue)) } return interceptor(ctx, in, info, handler) } @@ -2402,8 +2402,8 @@ var Bridge_ServiceDesc = grpc.ServiceDesc{ Handler: _Bridge_AutoconfigClicked_Handler, }, { - MethodName: "KBArticleClicked", - Handler: _Bridge_KBArticleClicked_Handler, + MethodName: "ExternalLinkClicked", + Handler: _Bridge_ExternalLinkClicked_Handler, }, { MethodName: "IsTLSCertificateInstalled", diff --git a/internal/frontend/grpc/service_telemetry.go b/internal/frontend/grpc/service_telemetry.go index bbabf488..d65848ce 100644 --- a/internal/frontend/grpc/service_telemetry.go +++ b/internal/frontend/grpc/service_telemetry.go @@ -34,7 +34,7 @@ func (s *Service) AutoconfigClicked(_ context.Context, client *wrapperspb.String return &emptypb.Empty{}, nil } -func (s *Service) KBArticleClicked(_ context.Context, article *wrapperspb.StringValue) (*emptypb.Empty, error) { - s.bridge.KBArticleOpened(article.Value) +func (s *Service) ExternalLinkClicked(_ context.Context, article *wrapperspb.StringValue) (*emptypb.Empty, error) { + s.bridge.ExternalLinkClicked(article.Value) return &emptypb.Empty{}, nil } diff --git a/internal/user/config_status.go b/internal/user/config_status.go index 935fa6a4..51573529 100644 --- a/internal/user/config_status.go +++ b/internal/user/config_status.go @@ -193,21 +193,33 @@ func (user *User) AutoconfigUsed(client string) { } } -func (user *User) KBArticleOpened(article string) { +func (user *User) ExternalLinkClicked(article string) { if !user.configStatus.IsPending() { return } - var kb_articles_to_track = [...]string{ + var trackedLinks = [...]string{ "https://proton.me/support/bridge", "https://proton.me/support/protonmail-bridge-clients-apple-mail", "https://proton.me/support/protonmail-bridge-clients-macos-outlook-2019", "https://proton.me/support/protonmail-bridge-clients-windows-outlook-2019", "https://proton.me/support/protonmail-bridge-clients-windows-thunderbird", "https://proton.me/support/protonmail-bridge-configure-client", + "https://proton.me/support/bridge-address-list-has-changed", + "https://proton.me/blog/tls-ssl-certificate#Extra-security-precautions-taken-by-ProtonMail", + "https://proton.me/support/bridge-cant-move-cache", + "https://proton.me/support/difference-combined-addresses-mode-split-addresses-mode", + "https://proton.me/support/bridge-imap-login-failed", + "https://proton.me/support/port-already-occupied-error", + "https://proton.me/support/bridge-cannot-access-keychain", + "https://proton.me/support/protonmail-bridge-manual-update", + "https://proton.me/support/bridge-internal-error", + "https://proton.me/support/apple-mail-certificate", + "https://proton.me/support/macos-certificate-warning", + "https://proton.me/support/why-you-need-bridge", } - for id, url := range kb_articles_to_track { + for id, url := range trackedLinks { if url == article { if err := user.configStatus.RecordLinkClicked(uint(id)); err != nil { user.log.WithError(err).Error("Failed to log LinkClicked in config_status.")