forked from GitHub-Mirror/riotX-android
TimelineEvent : update sender data when loading room members and prune event (+ remove RoomSummaryMapper param)
This commit is contained in:
@ -73,7 +73,7 @@ class HomeActivityViewModel @AssistedInject constructor(@Assisted initialState:
|
||||
private fun observeRoomAndGroup() {
|
||||
Observable
|
||||
.combineLatest<List<RoomSummary>, Option<GroupSummary>, List<RoomSummary>>(
|
||||
session.rx().liveRoomSummaries(fetchLastEvents = true).throttleLast(300, TimeUnit.MILLISECONDS),
|
||||
session.rx().liveRoomSummaries().throttleLast(300, TimeUnit.MILLISECONDS),
|
||||
selectedGroupStore.observe(),
|
||||
BiFunction { rooms, selectedGroupOption ->
|
||||
val selectedGroup = selectedGroupOption.orNull()
|
||||
|
@ -500,17 +500,7 @@ class RoomDetailViewModel @AssistedInject constructor(@Assisted initialState: Ro
|
||||
}
|
||||
|
||||
private fun observeRoomSummary() {
|
||||
room.rx().liveRoomSummary(false)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.flatMap {
|
||||
if (it.membership != Membership.INVITE || it.latestEvent != null) {
|
||||
// Not an invitation, or already fetching last event
|
||||
Observable.just(it)
|
||||
} else {
|
||||
// We need the last event
|
||||
room.rx().liveRoomSummary(true)
|
||||
}
|
||||
}
|
||||
room.rx().liveRoomSummary()
|
||||
.execute { async ->
|
||||
copy(
|
||||
asyncRoomSummary = async,
|
||||
|
@ -86,7 +86,7 @@ class RoomDirectoryViewModel @AssistedInject constructor(@Assisted initialState:
|
||||
private fun observeJoinedRooms() {
|
||||
session
|
||||
.rx()
|
||||
.liveRoomSummaries(fetchLastEvents = false)
|
||||
.liveRoomSummaries()
|
||||
.subscribe { list ->
|
||||
val joinedRoomIds = list
|
||||
// Keep only joined room
|
||||
|
@ -54,7 +54,7 @@ class RoomPreviewViewModel @AssistedInject constructor(@Assisted initialState: R
|
||||
private fun observeJoinedRooms() {
|
||||
session
|
||||
.rx()
|
||||
.liveRoomSummaries(fetchLastEvents = false)
|
||||
.liveRoomSummaries()
|
||||
.subscribe { list ->
|
||||
withState { state ->
|
||||
val isRoomJoined = list
|
||||
|
Reference in New Issue
Block a user