mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Should fix issue with DM creation where we can ends up with DM in rooms
This commit is contained in:
parent
d520dfe108
commit
1b8b59076c
@ -31,9 +31,11 @@ internal class DirectChatsHelper @Inject constructor(@SessionDatabase
|
|||||||
*/
|
*/
|
||||||
fun getLocalUserAccount(filterRoomId: String? = null): MutableMap<String, MutableList<String>> {
|
fun getLocalUserAccount(filterRoomId: String? = null): MutableMap<String, MutableList<String>> {
|
||||||
return Realm.getInstance(realmConfiguration).use { realm ->
|
return Realm.getInstance(realmConfiguration).use { realm ->
|
||||||
|
// Makes sure we have the latest realm updates, this is important as we sent this information to the server.
|
||||||
|
realm.refresh()
|
||||||
RoomSummaryEntity.getDirectRooms(realm)
|
RoomSummaryEntity.getDirectRooms(realm)
|
||||||
.asSequence()
|
.asSequence()
|
||||||
.filter { it.roomId != filterRoomId && it.directUserId != null }
|
.filter { it.roomId != filterRoomId && it.directUserId != null && it.membership.isActive() }
|
||||||
.groupByTo(mutableMapOf(), { it.directUserId!! }, { it.roomId })
|
.groupByTo(mutableMapOf(), { it.directUserId!! }, { it.roomId })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user