Fixed PushWoosh kMapLastDownloaded sending

This commit is contained in:
r.kuznetsov 2017-02-27 16:02:06 +03:00 committed by Sergey Yershov
parent 73005eada2
commit 4855a63f12

View file

@ -702,6 +702,19 @@ void Storage::OnMapFileDownloadFinished(bool success,
}
OnMapDownloadFinished(countryId, success, queuedCountry.GetInitOptions());
// 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));
}
CorrectJustDownloadedAndQueue(m_queue.begin());
SaveDownloadQueue();
@ -1560,18 +1573,6 @@ bool Storage::GetUpdateInfo(TCountryId const & countryId, UpdateInfo & updateInf
void Storage::CorrectJustDownloadedAndQueue(TQueue::iterator justDownloadedItem)
{
// Send stastics to Push Woosh.
{
GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapLastDownloaded,
justDownloadedItem->GetCountryId());
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));
}
m_justDownloaded.insert(justDownloadedItem->GetCountryId());
m_queue.erase(justDownloadedItem);
if (m_queue.empty())