mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-28 16:20:50 +00:00
Use our anonymous UUID to identify Sentry users
This commit is contained in:
parent
c6c1393402
commit
f07dc53d83
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2020 Igara Studio S.A.
|
||||
// Copyright (C) 2020-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2017 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -21,6 +21,10 @@
|
||||
#include "base/version.h"
|
||||
#include "ver/info.h"
|
||||
|
||||
#if ENABLE_SENTRY
|
||||
#include "app/sentry_wrapper.h"
|
||||
#endif
|
||||
|
||||
#include <ctime>
|
||||
#include <sstream>
|
||||
|
||||
@ -113,6 +117,14 @@ CheckUpdateThreadLauncher::~CheckUpdateThreadLauncher()
|
||||
|
||||
void CheckUpdateThreadLauncher::launch()
|
||||
{
|
||||
if (m_uuid.empty())
|
||||
m_uuid = m_preferences.updater.uuid();
|
||||
|
||||
#if ENABLE_SENTRY
|
||||
if (!m_uuid.empty())
|
||||
Sentry::setUserID(m_uuid);
|
||||
#endif
|
||||
|
||||
// In this case we are in the "wait days" period, so we don't check
|
||||
// for updates.
|
||||
if (!m_doCheck) {
|
||||
@ -120,9 +132,6 @@ void CheckUpdateThreadLauncher::launch()
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_uuid.empty())
|
||||
m_uuid = m_preferences.updater.uuid();
|
||||
|
||||
m_delegate->onCheckingUpdates();
|
||||
|
||||
m_bgJob.reset(new CheckUpdateBackgroundJob);
|
||||
@ -168,6 +177,11 @@ void CheckUpdateThreadLauncher::onMonitoringTick()
|
||||
if (!m_response.getUuid().empty()) {
|
||||
m_uuid = m_response.getUuid();
|
||||
m_preferences.updater.uuid(m_uuid);
|
||||
|
||||
#if ENABLE_SENTRY
|
||||
if (!m_uuid.empty())
|
||||
Sentry::setUserID(m_uuid);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set the date of the last "check for updates" and the "WaitDays" parameter.
|
||||
|
@ -50,6 +50,14 @@ Sentry::~Sentry()
|
||||
sentry_close();
|
||||
}
|
||||
|
||||
// static
|
||||
void Sentry::setUserID(const std::string& uuid)
|
||||
{
|
||||
sentry_value_t user = sentry_value_new_object();
|
||||
sentry_value_set_by_key(user, "id", sentry_value_new_string(uuid.c_str()));
|
||||
sentry_set_user(user);
|
||||
}
|
||||
|
||||
// static
|
||||
bool Sentry::requireConsent()
|
||||
{
|
||||
|
@ -22,6 +22,8 @@ public:
|
||||
void init();
|
||||
~Sentry();
|
||||
|
||||
static void setUserID(const std::string& uuid);
|
||||
|
||||
static bool requireConsent();
|
||||
static bool consentGiven();
|
||||
static void giveConsent();
|
||||
|
Loading…
x
Reference in New Issue
Block a user