forked from GitHub-Mirror/riotX-android
RoomSummary : clean some old code
This commit is contained in:
parent
7669a94a64
commit
f5d64a5707
@ -5,16 +5,15 @@ import io.realm.RealmObject
|
|||||||
import io.realm.annotations.PrimaryKey
|
import io.realm.annotations.PrimaryKey
|
||||||
|
|
||||||
internal open class RoomSummaryEntity(@PrimaryKey var roomId: String = "",
|
internal open class RoomSummaryEntity(@PrimaryKey var roomId: String = "",
|
||||||
var displayName: String? = "",
|
var displayName: String? = "",
|
||||||
var avatarUrl: String? = "",
|
var avatarUrl: String? = "",
|
||||||
var topic: String? = "",
|
var topic: String? = "",
|
||||||
var lastMessage: EventEntity? = null,
|
var lastMessage: EventEntity? = null,
|
||||||
var heroes: RealmList<String> = RealmList(),
|
var heroes: RealmList<String> = RealmList(),
|
||||||
var joinedMembersCount: Int? = 0,
|
var joinedMembersCount: Int? = 0,
|
||||||
var invitedMembersCount: Int? = 0,
|
var invitedMembersCount: Int? = 0,
|
||||||
var isDirect: Boolean = false,
|
var isDirect: Boolean = false,
|
||||||
var isLatestSelected: Boolean = false,
|
var otherMemberIds: RealmList<String> = RealmList()
|
||||||
var otherMemberIds: RealmList<String> = RealmList()
|
|
||||||
) : RealmObject() {
|
) : RealmObject() {
|
||||||
|
|
||||||
companion object
|
companion object
|
||||||
|
@ -13,9 +13,3 @@ internal fun RoomSummaryEntity.Companion.where(realm: Realm, roomId: String? = n
|
|||||||
}
|
}
|
||||||
return query
|
return query
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun RoomSummaryEntity.Companion.lastSelected(realm: Realm): RoomSummaryEntity? {
|
|
||||||
return realm.where<RoomSummaryEntity>()
|
|
||||||
.equalTo(RoomSummaryEntityFields.IS_LATEST_SELECTED, true)
|
|
||||||
.findFirst()
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user