diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-08-14 14:01:26 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-08-14 14:51:35 +0300 |
commit | 17ae6bbb5cef04f82cb12262eee9a9f742894bfc (patch) | |
tree | a89809bac3e96cf7db37358ec1b25b6eeae9e91b /storage | |
parent | 590ffa325238fc3ef68bc2772928a32a40de2504 (diff) |
Fixed sending statistics to PushWoosh
Diffstat (limited to 'storage')
-rw-r--r-- | storage/storage.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/storage/storage.cpp b/storage/storage.cpp index 071df59a73..a71551b079 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -763,16 +763,20 @@ void Storage::OnMapFileDownloadFinished(HttpRequest::Status status, return; } - // Send stastics to Push Woosh. - if (success) - { - GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapLastDownloaded, countryId); - char nowStr[18]{}; - auto const tp = std::chrono::system_clock::from_time_t(time(nullptr)); - tm now = my::GmTime(std::chrono::system_clock::to_time_t(tp)); - strftime(nowStr, sizeof(nowStr), "%Y-%m-%d %H:%M", &now); - GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapLastDownloadedTimestamp, - std::string(nowStr)); + // Send statistics to PushWoosh. We send these statistics only for the newly downloaded + // mwms, not for updated ones. + if (success && queuedCountry.GetInitOptions() != MapOptions::Diff) + { + auto const it = m_localFiles.find(countryId); + if (it == m_localFiles.end()) + { + GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapLastDownloaded, countryId); + char nowStr[18]{}; + tm now = my::GmTime(time(nullptr)); + strftime(nowStr, sizeof(nowStr), "%Y-%m-%d %H:%M", &now); + GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapLastDownloadedTimestamp, + std::string(nowStr)); + } } OnMapDownloadFinished(countryId, status, queuedCountry.GetInitOptions()); |