Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2018-10-29 19:02:55 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2018-10-30 12:55:06 +0300
commitc515cf0e39bc825271196f1ef2e92aa6a2c9671a (patch)
treed76ab991930bf1da5ddf34d5c03ab14e6473666b /local_ads
parent12f0fc0503e958309b99ec492c6f5df32af41228 (diff)
Use hash as user id in statistics.
Diffstat (limited to 'local_ads')
-rw-r--r--local_ads/local_ads_tests/CMakeLists.txt1
-rw-r--r--local_ads/statistics.cpp8
2 files changed, 8 insertions, 1 deletions
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<local_ads::Event> 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()