MESSENGER-4549 Enable locationsharing per default when there is an url in well-known

This commit is contained in:
Frank Rotermund
2023-08-16 08:37:15 +02:00
parent b2f78a2ced
commit 7568f86a95
7 changed files with 20 additions and 8 deletions
+13 -2
View File
@@ -2445,7 +2445,7 @@ static CGSize kThreadListBarButtonItemImageSize;
[self.delegate roomViewControllerDidRequestPollCreationFormPresentation:self];
}]];
}
if (BWIBuildSettings.shared.locationSharingEnabled && !self.isNewDirectChat)
if ( [self bwiShowLocationSharingUI:self.roomDataSource.mxSession] && !self.isNewDirectChat)
{
[actionItems addObject:[[RoomActionItem alloc] initWithImage:AssetImages.actionLocation.image andAction:^{
MXStrongifyAndReturnIfNil(self);
@@ -5299,7 +5299,7 @@ static CGSize kThreadListBarButtonItemImageSize;
{
[actionItems addObject:@(ComposerCreateActionPolls)];
}
if (BWIBuildSettings.shared.locationSharingEnabled && !self.isNewDirectChat)
if ([self bwiShowLocationSharingUI:self.roomDataSource.mxSession] && !self.isNewDirectChat)
{
[actionItems addObject:@(ComposerCreateActionLocation)];
}
@@ -8234,6 +8234,17 @@ static CGSize kThreadListBarButtonItemImageSize;
[service addReactionWithReaction:emoji];
}
#pragma mark - BWI Helper
// (bwi #4549): Showing Location Sharing in UI depends on BuildSetting and url from well-known. If there is only the default url that was not overwritten by well-known, the UI will not be shown
- (BOOL) bwiShowLocationSharingUI:(MXSession*)session {
if (session) {
return BWIBuildSettings.shared.locationSharingEnabled && ![session.vc_homeserverConfiguration.tileServer.mapStyleURL.absoluteString isEqualToString:BWIBuildSettings.shared.serverConfigDefaultMapstyleURLString];
} else {
return NO;
}
}
#pragma mark - UserSuggestionCoordinatorBridgeDelegate
- (void)completionSuggestionCoordinatorBridge:(CompletionSuggestionCoordinatorBridge *)coordinator