findAll() does not return null value
This commit is contained in:
parent
9aadbbc3c7
commit
34c5f37bbc
|
@ -110,9 +110,11 @@ internal class ShieldTrustUpdater @Inject constructor(
|
|||
|
||||
val map = HashMap<String, List<String>>()
|
||||
impactedRoomsId.forEach { roomId ->
|
||||
RoomMemberSummaryEntity.where(backgroundSessionRealm.get(), roomId).findAll()?.let { results ->
|
||||
map[roomId] = results.map { it.userId }
|
||||
}
|
||||
RoomMemberSummaryEntity.where(backgroundSessionRealm.get(), roomId)
|
||||
.findAll()
|
||||
.let { results ->
|
||||
map[roomId] = results.map { it.userId }
|
||||
}
|
||||
}
|
||||
|
||||
map.forEach { entry ->
|
||||
|
|
|
@ -54,13 +54,11 @@ internal class DefaultRoomGetter @Inject constructor(
|
|||
Realm.getInstance(monarchy.realmConfiguration).use { realm ->
|
||||
val candidates = RoomSummaryEntity.where(realm)
|
||||
.equalTo(RoomSummaryEntityFields.IS_DIRECT, true)
|
||||
.findAll()?.filter { dm ->
|
||||
.findAll()
|
||||
.filter { dm ->
|
||||
dm.otherMemberIds.contains(otherUserId)
|
||||
&& dm.membership == Membership.JOIN
|
||||
}?.map {
|
||||
it.roomId
|
||||
}
|
||||
?: return null
|
||||
}.map { it.roomId }
|
||||
candidates.forEach { roomId ->
|
||||
if (RoomMemberHelper(realm, roomId).getActiveRoomMemberIds().any { it == otherUserId }) {
|
||||
return RoomEntity.where(realm, roomId).findFirst()?.let { roomFactory.create(roomId) }
|
||||
|
|
Loading…
Reference in New Issue