mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
Remove fetching thread summaries when homeserver do not support MSC3440
This commit is contained in:
parent
8b254212af
commit
eda723c230
2 changed files with 8 additions and 5 deletions
|
@ -70,7 +70,8 @@ internal data class Capabilities(
|
|||
* Capability to indicate if the server supports MSC3440 Threading
|
||||
* True if the user can use m.thread relation, false otherwise
|
||||
*/
|
||||
@Json(name = "m.thread")
|
||||
// @Json(name = "m.thread")
|
||||
@Json(name = "io.element.thread")
|
||||
val threads: BooleanCapability? = null
|
||||
)
|
||||
|
||||
|
|
|
@ -54,8 +54,7 @@ class ThreadListViewModel @AssistedInject constructor(@Assisted val initialState
|
|||
}
|
||||
|
||||
init {
|
||||
observeThreads()
|
||||
fetchThreadList()
|
||||
fetchAndObserveThreads()
|
||||
}
|
||||
|
||||
override fun handle(action: EmptyAction) {}
|
||||
|
@ -64,9 +63,12 @@ class ThreadListViewModel @AssistedInject constructor(@Assisted val initialState
|
|||
* Observing thread list with respect to homeserver
|
||||
* capabilities
|
||||
*/
|
||||
private fun observeThreads() {
|
||||
private fun fetchAndObserveThreads() {
|
||||
when (session.getHomeServerCapabilities().canUseThreading) {
|
||||
true -> observeThreadSummaries()
|
||||
true -> {
|
||||
fetchThreadList()
|
||||
observeThreadSummaries()
|
||||
}
|
||||
false -> observeThreadsList()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue