diff --git a/local_ads/local_ads_tests/CMakeLists.txt b/local_ads/local_ads_tests/CMakeLists.txt index 4ccc7fd5b6..b618c8afa1 100644 --- a/local_ads/local_ads_tests/CMakeLists.txt +++ b/local_ads/local_ads_tests/CMakeLists.txt @@ -18,6 +18,7 @@ omim_link_libraries( geometry base jansson + oauthcpp stats_client ${LIBZ} ) diff --git a/local_ads/statistics.cpp b/local_ads/statistics.cpp index 1d30f7a453..b631d06832 100644 --- a/local_ads/statistics.cpp +++ b/local_ads/statistics.cpp @@ -10,6 +10,7 @@ #include "coding/file_writer.hpp" #include "coding/point_to_integer.hpp" #include "coding/pointd_to_pointu.hpp" +#include "coding/sha1.hpp" #include "coding/url_encode.hpp" #include "coding/write_to_sink.hpp" #include "coding/zlib.hpp" @@ -128,6 +129,11 @@ local_ads::Timestamp GetMaxTimestamp(std::list const & events, return maxTimestamp; } +std::string GetClientIdHash() +{ + return coding::SHA1::CalculateBase64ForString(GetPlatform().UniqueClientId()); +} + std::string GetPath(std::string const & fileName) { return base::JoinFoldersToPath({GetPlatform().SettingsDir(), kStatisticsFolderName}, fileName); @@ -239,7 +245,7 @@ bool CanUpload() namespace local_ads { Statistics::Statistics() - : m_userId(GetPlatform().UniqueClientId()) + : m_userId(GetClientIdHash()) {} void Statistics::Startup()