mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-06 04:24:29 +00:00
[ios] Added Mastodon & Bluesky
This commit is contained in:
committed by
Yannik Bloscheck
parent
fe92bf2359
commit
e500a9e5fa
@@ -669,7 +669,15 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
|
||||
text:L(@"outdoor_seating")
|
||||
value:feature::YesNoUnknownFromString(m_mapObject.GetMetadata(feature::Metadata::FMD_OUTDOOR_SEATING))];
|
||||
break;
|
||||
}
|
||||
}
|
||||
case MetadataID::FMD_CONTACT_FEDIVERSE:
|
||||
{
|
||||
[self configTextViewCell:cell
|
||||
cellID:cellID
|
||||
icon:@"ic_placepage_fediverse"
|
||||
placeholder:L(@"fediverse")];
|
||||
break;
|
||||
}
|
||||
case MetadataID::FMD_CONTACT_FACEBOOK:
|
||||
{
|
||||
[self configTextViewCell:cell
|
||||
@@ -710,6 +718,14 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
|
||||
placeholder:L(@"line")];
|
||||
break;
|
||||
}
|
||||
case MetadataID::FMD_CONTACT_BLUESKY:
|
||||
{
|
||||
[self configTextViewCell:cell
|
||||
cellID:cellID
|
||||
icon:@"ic_placepage_bluesky"
|
||||
placeholder:L(@"bluesky")];
|
||||
break;
|
||||
}
|
||||
case MWMEditorCellTypeNote:
|
||||
{
|
||||
MWMNoteCell * tCell = static_cast<MWMNoteCell *>(cell);
|
||||
|
||||
@@ -79,11 +79,13 @@ protocol PlacePageInfoViewControllerDelegate: AnyObject {
|
||||
func didPressWebsiteMenu()
|
||||
func didPressWikipedia()
|
||||
func didPressWikimediaCommons()
|
||||
func didPressFediverse()
|
||||
func didPressFacebook()
|
||||
func didPressInstagram()
|
||||
func didPressTwitter()
|
||||
func didPressVk()
|
||||
func didPressLine()
|
||||
func didPressBluesky()
|
||||
func didPressEmail()
|
||||
func didPressOpenInApp(from sourceView: UIView)
|
||||
func didCopy(_ content: String)
|
||||
@@ -109,11 +111,13 @@ class PlacePageInfoViewController: UIViewController {
|
||||
private var wikipediaView: InfoItemViewController?
|
||||
private var wikimediaCommonsView: InfoItemViewController?
|
||||
private var emailView: InfoItemViewController?
|
||||
private var fediverseView: InfoItemViewController?
|
||||
private var facebookView: InfoItemViewController?
|
||||
private var instagramView: InfoItemViewController?
|
||||
private var twitterView: InfoItemViewController?
|
||||
private var vkView: InfoItemViewController?
|
||||
private var lineView: InfoItemViewController?
|
||||
private var blueskyView: InfoItemViewController?
|
||||
private var cuisineView: InfoItemViewController?
|
||||
private var operatorView: InfoItemViewController?
|
||||
private var wifiView: InfoItemViewController?
|
||||
@@ -274,6 +278,18 @@ class PlacePageInfoViewController: UIViewController {
|
||||
})
|
||||
}
|
||||
|
||||
if let fediverse = placePageInfoData.fediverse {
|
||||
fediverseView = createInfoItem(fediverse,
|
||||
icon: UIImage(named: "ic_placepage_fediverse"),
|
||||
style: .link,
|
||||
tapHandler: { [weak self] in
|
||||
self?.delegate?.didPressFediverse()
|
||||
},
|
||||
longPressHandler: { [weak self] in
|
||||
self?.delegate?.didCopy(fediverse)
|
||||
})
|
||||
}
|
||||
|
||||
if let facebook = placePageInfoData.facebook {
|
||||
facebookView = createInfoItem(facebook,
|
||||
icon: UIImage(named: "ic_placepage_facebook"),
|
||||
@@ -333,6 +349,18 @@ class PlacePageInfoViewController: UIViewController {
|
||||
self?.delegate?.didCopy(line)
|
||||
})
|
||||
}
|
||||
|
||||
if let bluesky = placePageInfoData.line {
|
||||
blueskyView = createInfoItem(bluesky,
|
||||
icon: UIImage(named: "ic_placepage_bluesky"),
|
||||
style: .link,
|
||||
tapHandler: { [weak self] in
|
||||
self?.delegate?.didPressBluesky()
|
||||
},
|
||||
longPressHandler: { [weak self] in
|
||||
self?.delegate?.didCopy(bluesky)
|
||||
})
|
||||
}
|
||||
|
||||
if let address = placePageInfoData.address {
|
||||
addressView = createInfoItem(address,
|
||||
|
||||
@@ -100,6 +100,10 @@ extension PlacePageInteractor: PlacePageInfoViewControllerDelegate {
|
||||
MWMPlacePageManagerHelper.openWikimediaCommons(placePageData)
|
||||
}
|
||||
|
||||
func didPressFediverse() {
|
||||
MWMPlacePageManagerHelper.openFediverse(placePageData)
|
||||
}
|
||||
|
||||
func didPressFacebook() {
|
||||
MWMPlacePageManagerHelper.openFacebook(placePageData)
|
||||
}
|
||||
@@ -120,6 +124,10 @@ extension PlacePageInteractor: PlacePageInfoViewControllerDelegate {
|
||||
MWMPlacePageManagerHelper.openLine(placePageData)
|
||||
}
|
||||
|
||||
func didPressBluesky() {
|
||||
MWMPlacePageManagerHelper.openBluesky(placePageData)
|
||||
}
|
||||
|
||||
func didPressEmail() {
|
||||
MWMPlacePageManagerHelper.openEmail(placePageData)
|
||||
}
|
||||
|
||||
@@ -258,6 +258,11 @@ using namespace storage;
|
||||
[self.ownerViewController openUrl:data.infoData.wikimediaCommons externally:YES];
|
||||
}
|
||||
|
||||
- (void)openFediverse:(PlacePageData *)data {
|
||||
std::string const fullUrl = osm::socialContactToURL(osm::MapObject::MetadataID::FMD_CONTACT_FEDIVERSE, [data.infoData.fediverse UTF8String]);
|
||||
[self.ownerViewController openUrl:ToNSString(fullUrl) externally:YES];
|
||||
}
|
||||
|
||||
- (void)openFacebook:(PlacePageData *)data {
|
||||
std::string const fullUrl = osm::socialContactToURL(osm::MapObject::MetadataID::FMD_CONTACT_FACEBOOK, [data.infoData.facebook UTF8String]);
|
||||
[self.ownerViewController openUrl:ToNSString(fullUrl) externally:YES];
|
||||
@@ -283,6 +288,11 @@ using namespace storage;
|
||||
[self.ownerViewController openUrl:ToNSString(fullUrl) externally:YES];
|
||||
}
|
||||
|
||||
- (void)openBluesky:(PlacePageData *)data {
|
||||
std::string const fullUrl = osm::socialContactToURL(osm::MapObject::MetadataID::FMD_CONTACT_BLUESKY, [data.infoData.bluesky UTF8String]);
|
||||
[self.ownerViewController openUrl:ToNSString(fullUrl) externally:YES];
|
||||
}
|
||||
|
||||
- (void)openEmail:(PlacePageData *)data {
|
||||
[MailComposer sendEmailWithSubject:nil body:nil toRecipients:@[data.infoData.email] attachmentFileURL:nil];
|
||||
}
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
+ (void)openWikipedia:(PlacePageData *)data;
|
||||
+ (void)openWikimediaCommons:(PlacePageData *)data;
|
||||
+ (void)openEmail:(PlacePageData *)data;
|
||||
+ (void)openFediverse:(PlacePageData *)data;
|
||||
+ (void)openFacebook:(PlacePageData *)data;
|
||||
+ (void)openInstagram:(PlacePageData *)data;
|
||||
+ (void)openTwitter:(PlacePageData *)data;
|
||||
+ (void)openVk:(PlacePageData *)data;
|
||||
+ (void)openLine:(PlacePageData *)data;
|
||||
+ (void)openBluesky:(PlacePageData *)data;
|
||||
+ (void)call:(PlacePagePhone *)phone;
|
||||
+ (void)showAllFacilities:(PlacePageData *)data;
|
||||
+ (void)showPlaceDescription:(NSString *)htmlString;
|
||||
|
||||
@@ -19,11 +19,13 @@
|
||||
- (void)openWikipedia:(PlacePageData *)data;
|
||||
- (void)openWikimediaCommons:(PlacePageData *)data;
|
||||
- (void)openEmail:(PlacePageData *)data;
|
||||
- (void)openFediverse:(PlacePageData *)data;
|
||||
- (void)openFacebook:(PlacePageData *)data;
|
||||
- (void)openInstagram:(PlacePageData *)data;
|
||||
- (void)openTwitter:(PlacePageData *)data;
|
||||
- (void)openVk:(PlacePageData *)data;
|
||||
- (void)openLine:(PlacePageData *)data;
|
||||
- (void)openBluesky:(PlacePageData *)data;
|
||||
- (void)call:(PlacePagePhone *)phone;
|
||||
- (void)showAllFacilities:(PlacePageData *)data;
|
||||
- (void)showPlaceDescription:(NSString *)htmlString;
|
||||
@@ -89,6 +91,10 @@
|
||||
[[MWMMapViewControlsManager manager].placePageManager openWikimediaCommons:data];
|
||||
}
|
||||
|
||||
+ (void)openFediverse:(PlacePageData *)data {
|
||||
[[MWMMapViewControlsManager manager].placePageManager openFediverse:data];
|
||||
}
|
||||
|
||||
+ (void)openFacebook:(PlacePageData *)data {
|
||||
[[MWMMapViewControlsManager manager].placePageManager openFacebook:data];
|
||||
}
|
||||
@@ -109,6 +115,10 @@
|
||||
[[MWMMapViewControlsManager manager].placePageManager openLine:data];
|
||||
}
|
||||
|
||||
+ (void)openBluesky:(PlacePageData *)data {
|
||||
[[MWMMapViewControlsManager manager].placePageManager openBluesky:data];
|
||||
}
|
||||
|
||||
+ (void)call:(PlacePagePhone *)phone {
|
||||
[[MWMMapViewControlsManager manager].placePageManager call:phone];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user