mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-19 22:21:31 +00:00
Fix joining public chat crashing.
This commit is contained in:
parent
e484a95fcb
commit
a30d90ed29
@ -18,9 +18,9 @@ import nl.komponents.kovenant.ui.failUi
|
|||||||
import nl.komponents.kovenant.ui.successUi
|
import nl.komponents.kovenant.ui.successUi
|
||||||
import org.thoughtcrime.securesms.BaseActionBarActivity
|
import org.thoughtcrime.securesms.BaseActionBarActivity
|
||||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||||
import org.thoughtcrime.securesms.loki.redesign.utilities.OpenGroupUtilities
|
|
||||||
import org.thoughtcrime.securesms.loki.redesign.fragments.ScanQRCodeWrapperFragment
|
import org.thoughtcrime.securesms.loki.redesign.fragments.ScanQRCodeWrapperFragment
|
||||||
import org.thoughtcrime.securesms.loki.redesign.fragments.ScanQRCodeWrapperFragmentDelegate
|
import org.thoughtcrime.securesms.loki.redesign.fragments.ScanQRCodeWrapperFragmentDelegate
|
||||||
|
import org.thoughtcrime.securesms.loki.redesign.utilities.OpenGroupUtilities
|
||||||
import org.thoughtcrime.securesms.sms.MessageSender
|
import org.thoughtcrime.securesms.sms.MessageSender
|
||||||
|
|
||||||
class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCodeWrapperFragmentDelegate {
|
class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCodeWrapperFragmentDelegate {
|
||||||
@ -62,8 +62,10 @@ class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCode
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun joinPublicChatIfPossible(url: String) {
|
fun joinPublicChatIfPossible(url: String) {
|
||||||
|
runOnUiThread {
|
||||||
if (!Patterns.WEB_URL.matcher(url).matches() || !url.startsWith("https://")) {
|
if (!Patterns.WEB_URL.matcher(url).matches() || !url.startsWith("https://")) {
|
||||||
return Toast.makeText(this, "Invalid URL", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Invalid URL", Toast.LENGTH_SHORT).show()
|
||||||
|
return@runOnUiThread
|
||||||
}
|
}
|
||||||
showLoader()
|
showLoader()
|
||||||
|
|
||||||
@ -77,6 +79,7 @@ class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCode
|
|||||||
Toast.makeText(this, "Couldn't join channel", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Couldn't join channel", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user