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:
authorRoman Kuznetsov <r.kuznetsow@gmail.com>2017-10-09 17:22:13 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2017-10-09 17:22:13 +0300
commit73d013fb9dad6b61912744e6d60d7419d905ca9b (patch)
tree11129593a0135124172cdb01dc8b123f8edab281
parent47821176f58727466433433cc585df2a876ff3c1 (diff)
Added a sponsored project Thor (#7216)beta-1059
* Added a sponsored project Thor * Review fixes
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/Sponsored.java4
-rw-r--r--android/src/com/mapswithme/util/statistics/Statistics.java4
-rw-r--r--indexer/ftypes_matcher.cpp11
-rw-r--r--indexer/ftypes_matcher.hpp8
-rw-r--r--iphone/Maps/Common/Statistics/StatisticsStrings.h1
-rw-r--r--iphone/Maps/UI/PlacePage/MWMPlacePageData.h1
-rw-r--r--iphone/Maps/UI/PlacePage/MWMPlacePageData.mm1
-rw-r--r--iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm2
-rw-r--r--map/framework.cpp9
-rw-r--r--map/place_page_info.hpp3
-rw-r--r--platform/marketing_service.cpp3
-rw-r--r--platform/marketing_service.hpp1
12 files changed, 45 insertions, 3 deletions
diff --git a/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java b/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java
index aadb480fba..ab6f2c997f 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java
@@ -27,9 +27,11 @@ public final class Sponsored
public static final int TYPE_GEOCHAT = 3;
public static final int TYPE_VIATOR = 4;
public static final int TYPE_CIAN = 5;
+ public static final int TYPE_THOR = 6;
@Retention(RetentionPolicy.SOURCE)
- @IntDef({ TYPE_NONE, TYPE_BOOKING, TYPE_OPENTABLE, TYPE_GEOCHAT, TYPE_VIATOR, TYPE_CIAN })
+ @IntDef({ TYPE_NONE, TYPE_BOOKING, TYPE_OPENTABLE, TYPE_GEOCHAT,
+ TYPE_VIATOR, TYPE_CIAN, TYPE_THOR })
public @interface SponsoredType {}
private static class Price
diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java
index c066e1fceb..a6331db3c4 100644
--- a/android/src/com/mapswithme/util/statistics/Statistics.java
+++ b/android/src/com/mapswithme/util/statistics/Statistics.java
@@ -87,6 +87,7 @@ import static com.mapswithme.util.statistics.Statistics.ParamValue.GEOCHAT;
import static com.mapswithme.util.statistics.Statistics.ParamValue.OPENTABLE;
import static com.mapswithme.util.statistics.Statistics.ParamValue.SEARCH_BOOKING_COM;
import static com.mapswithme.util.statistics.Statistics.ParamValue.VIATOR;
+import static com.mapswithme.util.statistics.Statistics.ParamValue.THOR;
public enum Statistics
{
@@ -346,6 +347,7 @@ public enum Statistics
public static final String VIATOR = "Viator.Com";
public static final String GEOCHAT = "Geochat";
public static final String CIAN = "Cian.Ru";
+ public static final String THOR = "Thor";
public static final String NO_PRODUCTS = "no_products";
}
@@ -781,6 +783,8 @@ public enum Statistics
return OPENTABLE;
case Sponsored.TYPE_CIAN:
return CIAN;
+ case Sponsored.TYPE_THOR:
+ return THOR;
case Sponsored.TYPE_NONE:
return "N/A";
default:
diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp
index 4475adc0c6..ae335fc1d9 100644
--- a/indexer/ftypes_matcher.cpp
+++ b/indexer/ftypes_matcher.cpp
@@ -511,6 +511,17 @@ IsViatorChecker const & IsViatorChecker::Instance()
return inst;
}
+IsThorChecker::IsThorChecker()
+{
+ m_types.push_back(classif().GetTypeByPath({"sponsored", "thor"}));
+}
+
+IsThorChecker const & IsThorChecker::Instance()
+{
+ static IsThorChecker const inst;
+ return inst;
+}
+
IsPublicTransportStopChecker::IsPublicTransportStopChecker()
{
m_types.push_back(classif().GetTypeByPath({"highway", "bus_stop"}));
diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp
index 5378ed6612..5b1143e5d6 100644
--- a/indexer/ftypes_matcher.hpp
+++ b/indexer/ftypes_matcher.hpp
@@ -234,6 +234,14 @@ public:
static IsViatorChecker const & Instance();
};
+class IsThorChecker : public BaseChecker
+{
+ IsThorChecker();
+
+public:
+ static IsThorChecker const & Instance();
+};
+
class IsPublicTransportStopChecker : public BaseChecker
{
IsPublicTransportStopChecker();
diff --git a/iphone/Maps/Common/Statistics/StatisticsStrings.h b/iphone/Maps/Common/Statistics/StatisticsStrings.h
index fdca417af3..3e32df8af2 100644
--- a/iphone/Maps/Common/Statistics/StatisticsStrings.h
+++ b/iphone/Maps/Common/Statistics/StatisticsStrings.h
@@ -264,6 +264,7 @@ static NSString * const kStatTTSSettings = @"TTS settings";
static NSString * const kStatTable = @"Table";
static NSString * const kStatTags = @"tags";
static NSString * const kStatTaxi = @"Taxi";
+static NSString * const kStatThor = @"Thor";
static NSString * const kStatToLocation = @"to_location";
static NSString * const kStatToMyPosition = @"To my position";
static NSString * const kStatToggleBookmark = @"Toggle bookmark";
diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageData.h b/iphone/Maps/UI/PlacePage/MWMPlacePageData.h
index 56fb70637c..ed5c8d7f12 100644
--- a/iphone/Maps/UI/PlacePage/MWMPlacePageData.h
+++ b/iphone/Maps/UI/PlacePage/MWMPlacePageData.h
@@ -246,6 +246,7 @@ using CianIsReady = void (^)(NSArray<MWMCianItemModel *> * items);
- (BOOL)isOpentable;
- (BOOL)isViator;
- (BOOL)isCian;
+- (BOOL)isThor;
- (BOOL)isBookingSearch;
- (BOOL)isHTMLDescription;
- (BOOL)isMyPosition;
diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm
index 7f1870c772..4eee96608a 100644
--- a/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm
+++ b/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm
@@ -765,6 +765,7 @@ using namespace place_page;
- (BOOL)isOpentable { return m_info.GetSponsoredType() == SponsoredType::Opentable; }
- (BOOL)isViator { return m_info.GetSponsoredType() == SponsoredType::Viator; }
- (BOOL)isCian { return m_info.GetSponsoredType() == SponsoredType::Cian; }
+- (BOOL)isThor { return m_info.GetSponsoredType() == SponsoredType::Thor; }
- (BOOL)isBookingSearch { return !m_info.GetBookingSearchUrl().empty(); }
- (BOOL)isMyPosition { return m_info.IsMyPosition(); }
- (BOOL)isHTMLDescription { return strings::IsHTML(m_info.GetBookmarkData().GetDescription()); }
diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm
index f5e0affb90..a9626c0800 100644
--- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm
+++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm
@@ -252,6 +252,8 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName)
parameters[kStatProvider] = kStatBooking;
else if (data.isCian)
parameters[kStatProvider] = kStatCian;
+ else if (data.isThor)
+ parameters[kStatProvider] = kStatThor;
switch (Platform::ConnectionStatus())
{
case Platform::EConnectionType::CONNECTION_NONE:
diff --git a/map/framework.cpp b/map/framework.cpp
index 151fe63715..4d36efeac1 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -906,6 +906,15 @@ void Framework::FillInfoFromFeatureType(FeatureType const & ft, place_page::Info
info.SetSponsoredUrl(cian::Api::GetMainPageUrl());
info.SetPreviewIsExtended();
}
+ else if (ftypes::IsThorChecker::Instance()(ft) &&
+ !info.GetMetadata().Get(feature::Metadata::FMD_RATING).empty())
+ {
+ info.SetSponsoredType(place_page::SponsoredType::Thor);
+ auto const & url = info.GetMetadata().Get(feature::Metadata::FMD_WEBSITE);
+ info.SetSponsoredUrl(url);
+ info.SetSponsoredDescriptionUrl(url);
+ GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kSponsoredThorDiscovered);
+ }
FillLocalExperts(ft, info);
diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp
index 9c50ca50d6..d49e04eb5d 100644
--- a/map/place_page_info.hpp
+++ b/map/place_page_info.hpp
@@ -38,7 +38,8 @@ enum class SponsoredType
Opentable,
Geochat,
Viator,
- Cian
+ Cian,
+ Thor
};
enum class LocalAdsStatus
diff --git a/platform/marketing_service.cpp b/platform/marketing_service.cpp
index 5b02fa75ea..1ae4538b2a 100644
--- a/platform/marketing_service.cpp
+++ b/platform/marketing_service.cpp
@@ -22,6 +22,7 @@ char const * const kRoutingTransitDiscovered = "routing_transit_discovered";
char const * const kEditorAddDiscovered = "editor_add_discovered";
char const * const kEditorEditDiscovered = "editor_edit_discovered";
char const * const kTrafficDiscovered = "traffic_discovered";
+char const * const kSponsoredThorDiscovered = "sponsored_thor_discovered";
// Events.
char const * const kDownloaderMapActionFinished = "Downloader_Map_action_finished";
@@ -56,7 +57,7 @@ void MarketingService::ProcessFirstLaunch()
kEditorAddDiscovered, kEditorEditDiscovered,
- kTrafficDiscovered
+ kTrafficDiscovered, kSponsoredThorDiscovered
};
for (auto const & tag : tags)
diff --git a/platform/marketing_service.hpp b/platform/marketing_service.hpp
index bac4604c80..8bfec5f379 100644
--- a/platform/marketing_service.hpp
+++ b/platform/marketing_service.hpp
@@ -27,6 +27,7 @@ extern char const * const kRoutingTransitDiscovered;
extern char const * const kEditorAddDiscovered;
extern char const * const kEditorEditDiscovered;
extern char const * const kTrafficDiscovered;
+extern char const * const kSponsoredThorDiscovered;
// Events.
extern char const * const kDownloaderMapActionFinished;