feat(GODT-3046): report all clicked external links to bridge.

This commit is contained in:
Xavier Michelon
2023-11-27 10:39:07 +01:00
parent ec4ceb4552
commit 110cdbf3ae
21 changed files with 105 additions and 87 deletions

View File

@ -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.")