mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
fix: add support for non-standard ports in opengroupv2
This commit is contained in:
parent
f3fa8626ed
commit
d8e9e372d3
@ -95,7 +95,12 @@ class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCode
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
try {
|
||||
val (threadID, groupID) = if (isV2OpenGroup) {
|
||||
val server = HttpUrl.Builder().scheme(httpUrl.scheme()).host(httpUrl.host()).build()
|
||||
val server = HttpUrl.Builder().scheme(httpUrl.scheme()).host(httpUrl.host()).apply {
|
||||
if (httpUrl.port() != 80 || httpUrl.port() != 443) {
|
||||
// non-standard port, add to server
|
||||
this.port(httpUrl.port())
|
||||
}
|
||||
}.build()
|
||||
val group = OpenGroupUtilities.addGroup(this@JoinPublicChatActivity, server.toString().removeSuffix("/"), room!!, publicKey!!)
|
||||
val threadID = GroupManager.getOpenGroupThreadID(group.id, this@JoinPublicChatActivity)
|
||||
val groupID = GroupUtil.getEncodedOpenGroupID(group.id.toByteArray())
|
||||
|
@ -106,6 +106,7 @@ object OpenGroupAPIV2 {
|
||||
val urlBuilder = HttpUrl.Builder()
|
||||
.scheme(parsed.scheme())
|
||||
.host(parsed.host())
|
||||
.port(parsed.port())
|
||||
.addPathSegments(request.endpoint)
|
||||
|
||||
if (request.verb == GET) {
|
||||
|
Loading…
Reference in New Issue
Block a user