From 56c4918e9307ecf3079e130f0adf3edcfd103c7f Mon Sep 17 00:00:00 2001 From: Eugene Nikolsky Date: Wed, 2 Apr 2025 20:10:58 +0300 Subject: [PATCH] [ios] Pass specific phone to `call` instead of entire POI information For now, it doesn't change anything because there's still at most one phone, but this will help with multiple phone numbers because we'll need to know which phone number the user has picked. Signed-off-by: Eugene Nikolsky --- iphone/Maps/UI/PlacePage/PlacePageInteractor.swift | 4 ++-- .../UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm | 4 ++-- .../PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h | 3 ++- .../PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift b/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift index acd90b7f5..0e31df834 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift @@ -66,7 +66,7 @@ extension PlacePageInteractor: PlacePageInfoViewControllerDelegate { } func didPressCall() { - MWMPlacePageManagerHelper.call(placePageData) + MWMPlacePageManagerHelper.call(placePageData.infoData?.phone) } func didPressWebsite() { @@ -188,7 +188,7 @@ extension PlacePageInteractor: ActionBarViewControllerDelegate { MWMPlacePageManagerHelper.addBookmark(placePageData) } case .call: - MWMPlacePageManagerHelper.call(placePageData) + MWMPlacePageManagerHelper.call(placePageData.infoData?.phone) case .download: guard let mapNodeAttributes = placePageData.mapNodeAttributes else { fatalError("Download button can't be displayed if mapNodeAttributes is empty") diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm index 60e3c508c..1f365be9b 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm @@ -194,8 +194,8 @@ using namespace storage; f.GetBookmarkManager().GetEditSession().DeleteTrack(data.trackData.trackId); } -- (void)call:(PlacePageData *)data { - NSURL * _Nullable phoneURL = data.infoData.phone.url; +- (void)call:(PlacePagePhone *)phone { + NSURL * _Nullable phoneURL = phone.url; if (phoneURL && [UIApplication.sharedApplication canOpenURL:phoneURL]) { [UIApplication.sharedApplication openURL:phoneURL options:@{} completionHandler:nil]; } diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h index 1a3579386..b41a1d129 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h @@ -1,4 +1,5 @@ @class PlacePageData; +@class PlacePagePhone; @class ElevationProfileData; @interface MWMPlacePageManagerHelper : NSObject @@ -17,7 +18,7 @@ + (void)openTwitter:(PlacePageData *)data; + (void)openVk:(PlacePageData *)data; + (void)openLine:(PlacePageData *)data; -+ (void)call:(PlacePageData *)data; ++ (void)call:(PlacePagePhone *)phone; + (void)showAllFacilities:(PlacePageData *)data; + (void)showPlaceDescription:(NSString *)htmlString; + (void)openMoreUrl:(PlacePageData *)data; diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm index c92b871c1..5b5f5aa14 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm @@ -24,7 +24,7 @@ - (void)openTwitter:(PlacePageData *)data; - (void)openVk:(PlacePageData *)data; - (void)openLine:(PlacePageData *)data; -- (void)call:(PlacePageData *)data; +- (void)call:(PlacePagePhone *)phone; - (void)showAllFacilities:(PlacePageData *)data; - (void)showPlaceDescription:(NSString *)htmlString; - (void)openMoreUrl:(PlacePageData *)data; @@ -109,8 +109,8 @@ [[MWMMapViewControlsManager manager].placePageManager openLine:data]; } -+ (void)call:(PlacePageData *)data { - [[MWMMapViewControlsManager manager].placePageManager call:data]; ++ (void)call:(PlacePagePhone *)phone { + [[MWMMapViewControlsManager manager].placePageManager call:phone]; } + (void)showAllFacilities:(PlacePageData *)data {