Little changes after review
This commit is contained in:
parent
a993a30203
commit
b3e1c3969d
|
@ -22,15 +22,15 @@ import im.vector.matrix.android.internal.database.model.GroupSummaryEntity
|
|||
|
||||
internal object GroupSummaryMapper {
|
||||
|
||||
fun map(roomSummaryEntity: GroupSummaryEntity): GroupSummary {
|
||||
fun map(groupSummaryEntity: GroupSummaryEntity): GroupSummary {
|
||||
return GroupSummary(
|
||||
roomSummaryEntity.groupId,
|
||||
roomSummaryEntity.membership,
|
||||
roomSummaryEntity.displayName,
|
||||
roomSummaryEntity.shortDescription,
|
||||
roomSummaryEntity.avatarUrl,
|
||||
roomSummaryEntity.roomIds.toList(),
|
||||
roomSummaryEntity.userIds.toList()
|
||||
groupSummaryEntity.groupId,
|
||||
groupSummaryEntity.membership,
|
||||
groupSummaryEntity.displayName,
|
||||
groupSummaryEntity.shortDescription,
|
||||
groupSummaryEntity.avatarUrl,
|
||||
groupSummaryEntity.roomIds.toList(),
|
||||
groupSummaryEntity.userIds.toList()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,15 +47,16 @@ internal class GroupSummaryUpdater @Inject constructor(private val context: Cont
|
|||
val modifiedGroupEntity = (changeSet.insertions + changeSet.changes)
|
||||
.asSequence()
|
||||
.mapNotNull { results[it] }
|
||||
.toList()
|
||||
|
||||
fetchGroupsData(modifiedGroupEntity
|
||||
.filter { it.membership == Membership.JOIN || it.membership == Membership.INVITE }
|
||||
.map { it.groupId })
|
||||
.map { it.groupId }
|
||||
.toList())
|
||||
|
||||
deleteGroups(modifiedGroupEntity
|
||||
.filter { it.membership == Membership.LEAVE }
|
||||
.map { it.groupId })
|
||||
.map { it.groupId }
|
||||
.toList())
|
||||
}
|
||||
|
||||
private fun fetchGroupsData(groupIds: List<String>) {
|
||||
|
|
Loading…
Reference in New Issue