Merge pull request #86 from loki-project/open-group

Enable the User to Join an Open Group Without Entering "https://"
This commit is contained in:
gmbnt 2020-02-11 09:24:29 +11:00 committed by GitHub
commit f934b3c18b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,7 +133,10 @@ class EnterChatURLFragment : Fragment() {
private fun joinPublicChatIfPossible() { private fun joinPublicChatIfPossible() {
val inputMethodManager = context!!.getSystemService(BaseActionBarActivity.INPUT_METHOD_SERVICE) as InputMethodManager val inputMethodManager = context!!.getSystemService(BaseActionBarActivity.INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(chatURLEditText.windowToken, 0) 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) (activity!! as JoinPublicChatActivity).joinPublicChatIfPossible(chatURL)
} }
} }