mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +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) {
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val (threadID, groupID) = if (isV2OpenGroup) {
|
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 group = OpenGroupUtilities.addGroup(this@JoinPublicChatActivity, server.toString().removeSuffix("/"), room!!, publicKey!!)
|
||||||
val threadID = GroupManager.getOpenGroupThreadID(group.id, this@JoinPublicChatActivity)
|
val threadID = GroupManager.getOpenGroupThreadID(group.id, this@JoinPublicChatActivity)
|
||||||
val groupID = GroupUtil.getEncodedOpenGroupID(group.id.toByteArray())
|
val groupID = GroupUtil.getEncodedOpenGroupID(group.id.toByteArray())
|
||||||
|
@ -106,6 +106,7 @@ object OpenGroupAPIV2 {
|
|||||||
val urlBuilder = HttpUrl.Builder()
|
val urlBuilder = HttpUrl.Builder()
|
||||||
.scheme(parsed.scheme())
|
.scheme(parsed.scheme())
|
||||||
.host(parsed.host())
|
.host(parsed.host())
|
||||||
|
.port(parsed.port())
|
||||||
.addPathSegments(request.endpoint)
|
.addPathSegments(request.endpoint)
|
||||||
|
|
||||||
if (request.verb == GET) {
|
if (request.verb == GET) {
|
||||||
|
Loading…
Reference in New Issue
Block a user