mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Updated the code to parse an open group URL to handle a '/r/' before the room name
This commit is contained in:
parent
e6b941ea8a
commit
b077061714
1 changed files with 2 additions and 1 deletions
|
@ -117,7 +117,8 @@ public final class OpenGroupManagerV2 : NSObject {
|
|||
// https://143.198.213.225:443/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c
|
||||
// 143.198.213.255:80/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c
|
||||
let useTLS = (url.scheme == "https")
|
||||
let room = String(url.path.dropFirst()) // Drop the leading slash
|
||||
let updatedPath = (url.path.starts(with: "/r/") ? url.path.substring(from: 2) : url.path)
|
||||
let room = String(updatedPath.dropFirst()) // Drop the leading slash
|
||||
let queryParts = query.split(separator: "=")
|
||||
guard !room.isEmpty && !room.contains("/"), queryParts.count == 2, queryParts[0] == "public_key" else { return nil }
|
||||
let publicKey = String(queryParts[1])
|
||||
|
|
Loading…
Reference in a new issue