File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
vector/src/main/java/im/vector/app/features/settings/devices/v2/overview Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import im.vector.app.core.platform.VectorMenuProvider
39
39
import im.vector.app.core.resources.ColorProvider
40
40
import im.vector.app.core.resources.DrawableProvider
41
41
import im.vector.app.core.resources.StringProvider
42
+ import im.vector.app.core.utils.openUrlInChromeCustomTab
42
43
import im.vector.app.databinding.FragmentSessionOverviewBinding
43
44
import im.vector.app.features.auth.ReAuthActivity
44
45
import im.vector.app.features.crypto.recover.SetupMode
@@ -135,10 +136,19 @@ class SessionOverviewFragment :
135
136
activity?.let { SignOutUiWorker (it).perform() }
136
137
}
137
138
138
- private fun confirmSignoutOtherSession () {
139
- activity?.let {
140
- buildConfirmSignoutDialogUseCase.execute(it, this ::signoutSession)
141
- .show()
139
+ private fun confirmSignoutOtherSession () = withState(viewModel) { state ->
140
+ if (state.externalAccountManagementUrl != null ) {
141
+ // Manage in external account manager
142
+ openUrlInChromeCustomTab(
143
+ requireContext(),
144
+ null ,
145
+ state.externalAccountManagementUrl.removeSuffix(" /" ) + " ?action=session_end&device_id=${state.deviceId} "
146
+ )
147
+ } else {
148
+ activity?.let {
149
+ buildConfirmSignoutDialogUseCase.execute(it, this ::signoutSession)
150
+ .show()
151
+ }
142
152
}
143
153
}
144
154
Original file line number Diff line number Diff line change @@ -75,6 +75,18 @@ class SessionOverviewViewModel @AssistedInject constructor(
75
75
observeNotificationsStatus(initialState.deviceId)
76
76
refreshIpAddressVisibility()
77
77
observePreferences()
78
+ initExternalAccountManagementUrl()
79
+ }
80
+
81
+ private fun initExternalAccountManagementUrl () {
82
+ setState {
83
+ copy(
84
+ externalAccountManagementUrl = activeSessionHolder.getSafeActiveSession()
85
+ ?.homeServerCapabilitiesService()
86
+ ?.getHomeServerCapabilities()
87
+ ?.externalAccountManagementUrl
88
+ )
89
+ }
78
90
}
79
91
80
92
override fun onSharedPreferenceChanged (sharedPreferences : SharedPreferences ? , key : String? ) {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ data class SessionOverviewViewState(
29
29
val isLoading : Boolean = false ,
30
30
val notificationsStatus : NotificationsStatus = NotificationsStatus .NOT_SUPPORTED ,
31
31
val isShowingIpAddress : Boolean = false ,
32
+ val externalAccountManagementUrl : String? = null ,
32
33
) : MavericksState {
33
34
constructor (args: SessionOverviewArgs ) : this (
34
35
deviceId = args.deviceId
You can’t perform that action at this time.
0 commit comments