diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2016-10-19 14:16:49 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2016-10-21 20:34:02 +0300 |
commit | 58d5238d1506e234491440e86d6ffcea5cf345ed (patch) | |
tree | ac9611026c6a6c8d64aa91d464c68a34aa7e0a3b /map | |
parent | 6837b685335a30ab3861370926c17436d9e434c3 (diff) |
generate opentable URL by using sponsored id
Diffstat (limited to 'map')
-rw-r--r-- | map/framework.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index 2429def14d..42f82a8551 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -74,6 +74,8 @@ #include "geometry/rect2d.hpp" #include "geometry/triangle2d.hpp" +#include "partners_api/opentable_api.hpp" + #include "base/logging.hpp" #include "base/math.hpp" #include "base/scope_guard.hpp" @@ -792,14 +794,17 @@ void Framework::FillInfoFromFeatureType(FeatureType const & ft, place_page::Info if (ftypes::IsBookingChecker::Instance()(ft)) { info.m_sponsoredType = SponsoredType::Booking; - string const & baseUrl = info.GetMetadata().Get(feature::Metadata::FMD_WEBSITE); - info.m_sponsoredUrl = GetBookingApi().GetBookingUrl(baseUrl); + auto const & baseUrl = info.GetMetadata().Get(feature::Metadata::FMD_WEBSITE); + info.m_sponsoredUrl = GetBookingApi().GetBookHotelUrl(baseUrl); info.m_sponsoredDescriptionUrl = GetBookingApi().GetDescriptionUrl(baseUrl); } else if (ftypes::IsOpentableChecker::Instance()(ft)) { info.m_sponsoredType = SponsoredType::Opentable; - info.m_sponsoredUrl = info.GetMetadata().Get(feature::Metadata::FMD_WEBSITE); + auto const & sponsoredId = info.GetMetadata().Get(feature::Metadata::FMD_SPONSORED_ID); + auto const & url = opentable::Api::GetBookTableUrl(sponsoredId); + info.m_sponsoredUrl = url; + info.m_sponsoredDescriptionUrl = url; } |