Enable the user to join an open group without entering "https://"

This commit is contained in:
Niels Andriesse 2020-02-10 13:40:12 +11:00
parent 2ca7e8a5ce
commit 24df781259

View File

@ -133,7 +133,10 @@ class EnterChatURLFragment : Fragment() {
private fun joinPublicChatIfPossible() {
val inputMethodManager = context!!.getSystemService(BaseActionBarActivity.INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(chatURLEditText.windowToken, 0)
val chatURL = chatURLEditText.text.trim().toString().toLowerCase().replace("http://", "https://")
var chatURL = chatURLEditText.text.trim().toString().toLowerCase().replace("http://", "https://")
if (!chatURL.toLowerCase().startsWith("https")) {
chatURL = "https://$chatURL"
}
(activity!! as JoinPublicChatActivity).joinPublicChatIfPossible(chatURL)
}
}