Code quality
This commit is contained in:
parent
0c5ca9f51b
commit
48fef45ce3
|
@ -205,20 +205,14 @@ class RealmSessionStoreMigration @Inject constructor() : RealmMigration {
|
||||||
?.addField(SpaceChildSummaryEntityFields.AUTO_JOIN, Boolean::class.java)
|
?.addField(SpaceChildSummaryEntityFields.AUTO_JOIN, Boolean::class.java)
|
||||||
?.setNullable(SpaceChildSummaryEntityFields.AUTO_JOIN, true)
|
?.setNullable(SpaceChildSummaryEntityFields.AUTO_JOIN, true)
|
||||||
?.addRealmObjectField(SpaceChildSummaryEntityFields.CHILD_SUMMARY_ENTITY.`$`, realm.schema.get("RoomSummaryEntity")!!)
|
?.addRealmObjectField(SpaceChildSummaryEntityFields.CHILD_SUMMARY_ENTITY.`$`, realm.schema.get("RoomSummaryEntity")!!)
|
||||||
|
?.addRealmListField(SpaceChildSummaryEntityFields.VIA_SERVERS.`$`, String::class.java)
|
||||||
// realm.schema.create("SpaceSummaryEntity")
|
|
||||||
// ?.addField(SpaceSummaryEntityFields.SPACE_ID, String::class.java, FieldAttribute.PRIMARY_KEY)
|
|
||||||
// ?.setRequired(SpaceSummaryEntityFields.SPACE_ID, true)
|
|
||||||
// ?.addRealmObjectField(SpaceSummaryEntityFields.ROOM_SUMMARY_ENTITY.`$`, realm.schema.get("RoomSummaryEntity")!!)
|
|
||||||
// ?.addRealmListField(SpaceSummaryEntityFields.CHILDREN.`$`, spaceChildInfoSchema!!)
|
|
||||||
|
|
||||||
realm.schema.create("SpaceParentSummaryEntity")
|
realm.schema.create("SpaceParentSummaryEntity")
|
||||||
?.addField(SpaceParentSummaryEntityFields.PARENT_ROOM_ID, String::class.java)
|
?.addField(SpaceParentSummaryEntityFields.PARENT_ROOM_ID, String::class.java)
|
||||||
?.addField(SpaceParentSummaryEntityFields.CANONICAL, Boolean::class.java)
|
?.addField(SpaceParentSummaryEntityFields.CANONICAL, Boolean::class.java)
|
||||||
?.setNullable(SpaceParentSummaryEntityFields.CANONICAL, true)
|
?.setNullable(SpaceParentSummaryEntityFields.CANONICAL, true)
|
||||||
// ?.addRealmListField(RoomParentRelationInfoEntityFields.VIA_SERVERS.`$`, String::class.java)
|
|
||||||
// ?.addRealmObjectField(RoomParentRelationInfoEntityFields.SPACE_SUMMARY_ENTITY.`$`, realm.schema.get("SpaceSummaryEntity")!!)
|
|
||||||
?.addRealmObjectField(SpaceParentSummaryEntityFields.PARENT_SUMMARY_ENTITY.`$`, realm.schema.get("RoomSummaryEntity")!!)
|
?.addRealmObjectField(SpaceParentSummaryEntityFields.PARENT_SUMMARY_ENTITY.`$`, realm.schema.get("RoomSummaryEntity")!!)
|
||||||
|
?.addRealmListField(SpaceParentSummaryEntityFields.VIA_SERVERS.`$`, String::class.java)
|
||||||
|
|
||||||
realm.schema.get("RoomSummaryEntity")
|
realm.schema.get("RoomSummaryEntity")
|
||||||
?.addField(RoomSummaryEntityFields.ROOM_TYPE, String::class.java)
|
?.addField(RoomSummaryEntityFields.ROOM_TYPE, String::class.java)
|
||||||
|
|
|
@ -274,14 +274,13 @@ internal class RoomSummaryDataSource @Inject constructor(@SessionDatabase privat
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getFlattenOrphanRooms(): List<RoomSummary> {
|
fun getFlattenOrphanRooms(): List<RoomSummary> {
|
||||||
return getRoomSummaries(roomSummaryQueryParams {
|
return getRoomSummaries(
|
||||||
|
roomSummaryQueryParams {
|
||||||
memberships = Membership.activeMemberships()
|
memberships = Membership.activeMemberships()
|
||||||
excludeType = listOf(RoomType.SPACE)
|
excludeType = listOf(RoomType.SPACE)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
||||||
}).filter {
|
|
||||||
// we need to check if orphan
|
|
||||||
isOrphan(it)
|
|
||||||
}
|
}
|
||||||
|
).filter { isOrphan(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getFlattenOrphanRoomsLive(): LiveData<List<RoomSummary>> {
|
fun getFlattenOrphanRoomsLive(): LiveData<List<RoomSummary>> {
|
||||||
|
@ -290,10 +289,9 @@ internal class RoomSummaryDataSource @Inject constructor(@SessionDatabase privat
|
||||||
memberships = Membership.activeMemberships()
|
memberships = Membership.activeMemberships()
|
||||||
excludeType = listOf(RoomType.SPACE)
|
excludeType = listOf(RoomType.SPACE)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
||||||
})) {
|
})
|
||||||
it.filter {
|
) {
|
||||||
isOrphan(it)
|
it.filter { isOrphan(it) }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ Formatter\.formatShortFileSize===1
|
||||||
# android\.text\.TextUtils
|
# android\.text\.TextUtils
|
||||||
|
|
||||||
### This is not a rule, but a warning: the number of "enum class" has changed. For Json classes, it is mandatory that they have `@JsonClass(generateAdapter = false)`. If the enum is not used as a Json class, change the value in file forbidden_strings_in_code.txt
|
### This is not a rule, but a warning: the number of "enum class" has changed. For Json classes, it is mandatory that they have `@JsonClass(generateAdapter = false)`. If the enum is not used as a Json class, change the value in file forbidden_strings_in_code.txt
|
||||||
enum class===94
|
enum class===97
|
||||||
|
|
||||||
### Do not import temporary legacy classes
|
### Do not import temporary legacy classes
|
||||||
import org.matrix.android.sdk.internal.legacy.riot===3
|
import org.matrix.android.sdk.internal.legacy.riot===3
|
||||||
|
|
Loading…
Reference in New Issue