mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-09 09:27:42 +02:00
Merge pull request #5060 from vector-im/langleyd/4981_custom_baseurl_permalinks
Add clientPermalinkBaseUrl and set in matrix-sdk options.
This commit is contained in:
@@ -118,9 +118,9 @@ final class BuildSettings: NSObject {
|
||||
"https://element.io/help"
|
||||
|
||||
|
||||
// MARk: - Matrix permalinks
|
||||
// Paths for URLs that will considered as Matrix permalinks. Those permalinks are opened within the app
|
||||
static let matrixPermalinkPaths: [String: [String]] = [
|
||||
// MARK: - Permalinks
|
||||
// Hosts/Paths for URLs that will considered as valid permalinks. Those permalinks are opened within the app.
|
||||
static let permalinkSupportedHosts: [String: [String]] = [
|
||||
"app.element.io": [],
|
||||
"staging.element.io": [],
|
||||
"develop.element.io": [],
|
||||
@@ -133,8 +133,16 @@ final class BuildSettings: NSObject {
|
||||
// Official Matrix ones
|
||||
"matrix.to": ["/"],
|
||||
"www.matrix.to": ["/"],
|
||||
// Client Permalinks (for use with `BuildSettings.clientPermalinkBaseUrl`)
|
||||
// "example.com": ["/"],
|
||||
// "www.example.com": ["/"],
|
||||
]
|
||||
|
||||
// For use in clients that use a custom base url for permalinks rather than matrix.to.
|
||||
// This baseURL is used to generate permalinks within the app (E.g. timeline message permalinks).
|
||||
// Optional String that when set is used as permalink base, when nil matrix.to format is used.
|
||||
// Example value would be "https://www.example.com", note there is no trailing '/'.
|
||||
static let clientPermalinkBaseUrl: String? = "https://app.element.io"
|
||||
|
||||
// MARK: - VoIP
|
||||
static var allowVoIPUsage: Bool {
|
||||
|
||||
@@ -75,6 +75,7 @@ class CommonConfiguration: NSObject, Configurable {
|
||||
// Disable key backup on common
|
||||
sdkOptions.enableKeyBackupWhenStartingMXCrypto = false
|
||||
|
||||
sdkOptions.clientPermalinkBaseUrl = BuildSettings.clientPermalinkBaseUrl
|
||||
// Configure key provider delegate
|
||||
MXKeyProvider.sharedInstance().delegate = EncryptionKeyManager.shared
|
||||
}
|
||||
|
||||
+2
-2
@@ -66,11 +66,11 @@
|
||||
{
|
||||
BOOL isUniversalLink = NO;
|
||||
|
||||
for (NSString *matrixPermalinkHost in BuildSettings.matrixPermalinkPaths)
|
||||
for (NSString *matrixPermalinkHost in BuildSettings.permalinkSupportedHosts)
|
||||
{
|
||||
if ([url.host isEqualToString:matrixPermalinkHost])
|
||||
{
|
||||
NSArray<NSString*> *hostPaths = BuildSettings.matrixPermalinkPaths[matrixPermalinkHost];
|
||||
NSArray<NSString*> *hostPaths = BuildSettings.permalinkSupportedHosts[matrixPermalinkHost];
|
||||
if (hostPaths.count)
|
||||
{
|
||||
// iOS Patch: fix urls before using it
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Adds clientPermalinkBaseUrl for a custom permalink base url.
|
||||
Reference in New Issue
Block a user