Use RustSDK permalink builders:

- replace event permalinks on the room screen interaction handler
- replace the one use don the room details screen
- deprecate previous AttributedStringBuilder methods
- there's more work required on the AttributedStringBuilder mentions handler before we can completely drop the iOS implementations
This commit is contained in:
Stefan Ceriu
2024-04-01 10:07:30 +03:00
parent 2e6c5c036a
commit 834a830952
8 changed files with 104 additions and 26 deletions
@@ -92,6 +92,7 @@ enum PermalinkBuilder {
return url
}
@available(*, deprecated, message: "Use a room's `matrixToPermalink` method instead")
static func permalinkTo(roomIdentifier: String, baseURL: URL) throws -> URL {
guard MatrixEntityRegex.isMatrixRoomIdentifier(roomIdentifier) else {
throw PermalinkBuilderError.invalidRoomIdentifier
@@ -100,6 +101,7 @@ enum PermalinkBuilder {
return try permalinkTo(roomIdentifierOrAlias: roomIdentifier, baseURL: baseURL)
}
@available(*, deprecated, message: "Use a room's `matrixToPermalink` method instead")
static func permalinkTo(roomAlias: String, baseURL: URL) throws -> URL {
guard MatrixEntityRegex.isMatrixRoomAlias(roomAlias) else {
throw PermalinkBuilderError.invalidRoomAlias
@@ -108,6 +110,7 @@ enum PermalinkBuilder {
return try permalinkTo(roomIdentifierOrAlias: roomAlias, baseURL: baseURL)
}
@available(*, deprecated, message: "Use a room's `matrixToEventPermalink` method instead")
static func permalinkTo(eventIdentifier: String, roomIdentifier: String, baseURL: URL) throws -> URL {
guard MatrixEntityRegex.isMatrixEventIdentifier(eventIdentifier) else {
throw PermalinkBuilderError.invalidEventIdentifier