mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03: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
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue