mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Remove default identity server as we don't use it.
This commit is contained in:
parent
6176520805
commit
65f0af918f
@ -31,7 +31,7 @@ import okhttp3.TlsVersion
|
|||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class HomeServerConnectionConfig(
|
data class HomeServerConnectionConfig(
|
||||||
val homeServerUri: Uri,
|
val homeServerUri: Uri,
|
||||||
val identityServerUri: Uri,
|
val identityServerUri: Uri? = null,
|
||||||
val antiVirusServerUri: Uri? = null,
|
val antiVirusServerUri: Uri? = null,
|
||||||
val allowedFingerprints: MutableList<Fingerprint> = ArrayList(),
|
val allowedFingerprints: MutableList<Fingerprint> = ArrayList(),
|
||||||
val shouldPin: Boolean = false,
|
val shouldPin: Boolean = false,
|
||||||
@ -48,7 +48,7 @@ data class HomeServerConnectionConfig(
|
|||||||
class Builder {
|
class Builder {
|
||||||
|
|
||||||
private lateinit var homeServerUri: Uri
|
private lateinit var homeServerUri: Uri
|
||||||
private lateinit var identityServerUri: Uri
|
private var identityServerUri: Uri? = null
|
||||||
private var antiVirusServerUri: Uri? = null
|
private var antiVirusServerUri: Uri? = null
|
||||||
private val allowedFingerprints: MutableList<Fingerprint> = ArrayList()
|
private val allowedFingerprints: MutableList<Fingerprint> = ArrayList()
|
||||||
private var shouldPin: Boolean = false
|
private var shouldPin: Boolean = false
|
||||||
|
@ -128,8 +128,8 @@ class CreateRoomParams {
|
|||||||
contentMap["algorithm"] = algorithm
|
contentMap["algorithm"] = algorithm
|
||||||
|
|
||||||
val algoEvent = Event(type = EventType.ENCRYPTION,
|
val algoEvent = Event(type = EventType.ENCRYPTION,
|
||||||
stateKey = "",
|
stateKey = "",
|
||||||
content = contentMap.toContent()
|
content = contentMap.toContent()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (null == initialStates) {
|
if (null == initialStates) {
|
||||||
@ -162,8 +162,8 @@ class CreateRoomParams {
|
|||||||
contentMap["history_visibility"] = historyVisibility
|
contentMap["history_visibility"] = historyVisibility
|
||||||
|
|
||||||
val historyVisibilityEvent = Event(type = EventType.STATE_HISTORY_VISIBILITY,
|
val historyVisibilityEvent = Event(type = EventType.STATE_HISTORY_VISIBILITY,
|
||||||
stateKey = "",
|
stateKey = "",
|
||||||
content = contentMap.toContent())
|
content = contentMap.toContent())
|
||||||
|
|
||||||
if (null == initialStates) {
|
if (null == initialStates) {
|
||||||
initialStates = Arrays.asList<Event>(historyVisibilityEvent)
|
initialStates = Arrays.asList<Event>(historyVisibilityEvent)
|
||||||
@ -202,8 +202,8 @@ class CreateRoomParams {
|
|||||||
*/
|
*/
|
||||||
fun isDirect(): Boolean {
|
fun isDirect(): Boolean {
|
||||||
return preset == CreateRoomPreset.PRESET_TRUSTED_PRIVATE_CHAT
|
return preset == CreateRoomPreset.PRESET_TRUSTED_PRIVATE_CHAT
|
||||||
&& isDirect == true
|
&& isDirect == true
|
||||||
&& (1 == getInviteCount() || 1 == getInvite3PidCount())
|
&& (1 == getInviteCount() || 1 == getInvite3PidCount())
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -223,14 +223,13 @@ class CreateRoomParams {
|
|||||||
credentials: Credentials,
|
credentials: Credentials,
|
||||||
ids: List<String>) {
|
ids: List<String>) {
|
||||||
for (id in ids) {
|
for (id in ids) {
|
||||||
if (Patterns.EMAIL_ADDRESS.matcher(id).matches()) {
|
if (Patterns.EMAIL_ADDRESS.matcher(id).matches() && hsConfig.identityServerUri != null) {
|
||||||
if (null == invite3pids) {
|
if (null == invite3pids) {
|
||||||
invite3pids = ArrayList()
|
invite3pids = ArrayList()
|
||||||
}
|
}
|
||||||
|
|
||||||
val pid = Invite3Pid(idServer = hsConfig.identityServerUri.host!!,
|
val pid = Invite3Pid(idServer = hsConfig.identityServerUri.host!!,
|
||||||
medium = ThreePidMedium.EMAIL,
|
medium = ThreePidMedium.EMAIL,
|
||||||
address = id)
|
address = id)
|
||||||
|
|
||||||
invite3pids!!.add(pid)
|
invite3pids!!.add(pid)
|
||||||
} else if (isUserId(id)) {
|
} else if (isUserId(id)) {
|
||||||
|
@ -69,39 +69,19 @@ object ServerUrlsRepository {
|
|||||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
|
||||||
return prefs.getString(HOME_SERVER_URL_PREF,
|
return prefs.getString(HOME_SERVER_URL_PREF,
|
||||||
prefs.getString(DEFAULT_REFERRER_HOME_SERVER_URL_PREF,
|
prefs.getString(DEFAULT_REFERRER_HOME_SERVER_URL_PREF,
|
||||||
getDefaultHomeServerUrl(context)))
|
getDefaultHomeServerUrl(context)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return last used identity server url, or the default one from referrer or the default one from resources
|
|
||||||
*/
|
|
||||||
fun getLastIdentityServerUrl(context: Context): String {
|
|
||||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
|
||||||
|
|
||||||
return prefs.getString(IDENTITY_SERVER_URL_PREF,
|
|
||||||
prefs.getString(DEFAULT_REFERRER_IDENTITY_SERVER_URL_PREF,
|
|
||||||
getDefaultIdentityServerUrl(context)))
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if url is the default home server url form resources
|
* Return true if url is the default home server url form resources
|
||||||
*/
|
*/
|
||||||
fun isDefaultHomeServerUrl(context: Context, url: String) = url == getDefaultHomeServerUrl(context)
|
fun isDefaultHomeServerUrl(context: Context, url: String) = url == getDefaultHomeServerUrl(context)
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if url is the default identity server url form resources
|
|
||||||
*/
|
|
||||||
fun isDefaultIdentityServerUrl(context: Context, url: String) = url == getDefaultIdentityServerUrl(context)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return default home server url from resources
|
* Return default home server url from resources
|
||||||
*/
|
*/
|
||||||
fun getDefaultHomeServerUrl(context: Context): String = context.getString(R.string.default_hs_server_url)
|
fun getDefaultHomeServerUrl(context: Context): String = context.getString(R.string.default_hs_server_url)
|
||||||
|
|
||||||
/**
|
|
||||||
* Return default identity server url from resources
|
|
||||||
*/
|
|
||||||
fun getDefaultIdentityServerUrl(context: Context): String = context.getString(R.string.default_identity_server_url)
|
|
||||||
}
|
}
|
@ -37,6 +37,7 @@ import im.vector.riotx.core.platform.VectorBaseActivity
|
|||||||
import im.vector.riotx.core.utils.openUrlInExternalBrowser
|
import im.vector.riotx.core.utils.openUrlInExternalBrowser
|
||||||
import im.vector.riotx.features.disclaimer.showDisclaimerDialog
|
import im.vector.riotx.features.disclaimer.showDisclaimerDialog
|
||||||
import im.vector.riotx.features.home.HomeActivity
|
import im.vector.riotx.features.home.HomeActivity
|
||||||
|
import im.vector.riotx.features.homeserver.ServerUrlsRepository
|
||||||
import im.vector.riotx.features.notifications.PushRuleTriggerListener
|
import im.vector.riotx.features.notifications.PushRuleTriggerListener
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
import io.reactivex.functions.Function3
|
import io.reactivex.functions.Function3
|
||||||
@ -44,9 +45,6 @@ import io.reactivex.rxkotlin.subscribeBy
|
|||||||
import kotlinx.android.synthetic.main.activity_login.*
|
import kotlinx.android.synthetic.main.activity_login.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
private const val DEFAULT_HOME_SERVER_URI = "https://matrix.org"
|
|
||||||
private const val DEFAULT_IDENTITY_SERVER_URI = "https://vector.im"
|
|
||||||
private const val DEFAULT_ANTIVIRUS_SERVER_URI = "https://matrix.org"
|
|
||||||
|
|
||||||
class LoginActivity : VectorBaseActivity() {
|
class LoginActivity : VectorBaseActivity() {
|
||||||
|
|
||||||
@ -66,7 +64,7 @@ class LoginActivity : VectorBaseActivity() {
|
|||||||
setupNotice()
|
setupNotice()
|
||||||
setupAuthButton()
|
setupAuthButton()
|
||||||
setupPasswordReveal()
|
setupPasswordReveal()
|
||||||
homeServerField.setText(DEFAULT_HOME_SERVER_URI)
|
homeServerField.setText(ServerUrlsRepository.getDefaultHomeServerUrl(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupNotice() {
|
private fun setupNotice() {
|
||||||
@ -118,8 +116,6 @@ class LoginActivity : VectorBaseActivity() {
|
|||||||
val homeServerUri = homeServerField.text?.trim().toString()
|
val homeServerUri = homeServerField.text?.trim().toString()
|
||||||
HomeServerConnectionConfig.Builder()
|
HomeServerConnectionConfig.Builder()
|
||||||
.withHomeServerUri(homeServerUri)
|
.withHomeServerUri(homeServerUri)
|
||||||
.withIdentityServerUri(DEFAULT_IDENTITY_SERVER_URI)
|
|
||||||
.withAntiVirusServerUri(DEFAULT_ANTIVIRUS_SERVER_URI)
|
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,26 +4,16 @@
|
|||||||
<!-- "app_name" is now defined in build.gradle -->
|
<!-- "app_name" is now defined in build.gradle -->
|
||||||
|
|
||||||
<!-- server urls -->
|
<!-- server urls -->
|
||||||
<string name="vector_im_server_url" translatable="false">https://vector.im</string>
|
|
||||||
<string name="matrix_org_server_url" translatable="false">https://matrix.org</string>
|
<string name="matrix_org_server_url" translatable="false">https://matrix.org</string>
|
||||||
<string name="default_hs_server_url" translatable="false">https://matrix.org</string>
|
<string name="default_hs_server_url" translatable="false">https://matrix.org</string>
|
||||||
<string name="default_identity_server_url" translatable="false">https://vector.im</string>
|
|
||||||
<string name="piwik_server_url" translatable="false">https://piwik.riot.im</string>
|
<string name="piwik_server_url" translatable="false">https://piwik.riot.im</string>
|
||||||
<string name="bug_report_url" translatable="false">https://riot.im/bugreports/submit</string>
|
<string name="bug_report_url" translatable="false">https://riot.im/bugreports/submit</string>
|
||||||
|
|
||||||
<!-- Widget urls -->
|
|
||||||
<string name="integrations_ui_url" translatable="false">"https://scalar-staging.riot.im/scalar-web/"</string>
|
|
||||||
<string name="integrations_rest_url" translatable="false">"https://scalar-staging.riot.im/scalar/api"</string>
|
|
||||||
|
|
||||||
<string-array name="integrations_widgets_urls" translatable="false">
|
|
||||||
<item>https://scalar-staging.riot.im/scalar/api</item>
|
|
||||||
<item>https://scalar.vector.im/api</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Pusher config for the application
|
Pusher config for the application
|
||||||
https://matrix.org/docs/spec/client_server/r0.4.0#id128
|
https://matrix.org/docs/spec/client_server/r0.4.0#id128
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<string name="pusher_http_url" translatable="false">https://matrix.org/_matrix/push/v1/notify</string>
|
<string name="pusher_http_url" translatable="false">https://matrix.org/_matrix/push/v1/notify</string>
|
||||||
<string name="pusher_app_id" translatable="false">im.vector.app.android</string>
|
<string name="pusher_app_id" translatable="false">im.vector.app.android</string>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user