Skip to content
Snippets Groups Projects
Commit 7da41c61 authored by Taras's avatar Taras
Browse files

Change model

parent d6523973
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,13 @@ import org.futo.circles.extensions.getTimelineRoomFor ...@@ -5,11 +5,13 @@ import org.futo.circles.extensions.getTimelineRoomFor
import org.futo.circles.model.FollowingListItem import org.futo.circles.model.FollowingListItem
import org.matrix.android.sdk.api.session.room.model.RoomSummary import org.matrix.android.sdk.api.session.room.model.RoomSummary
fun RoomSummary.toFollowingListItem(circleId: String) = FollowingListItem( fun RoomSummary.toFollowingListItem(circleId: String, followInCirclesCount: Int) =
id = roomId, FollowingListItem(
name = nameOrId(), id = roomId,
ownerName = getRoomOwners(roomId).firstOrNull()?.displayName ?: "", name = nameOrId(),
avatarUrl = avatarUrl, ownerName = getRoomOwners(roomId).firstOrNull()?.displayName ?: "",
updatedTime = latestPreviewableEvent?.root?.originServerTs ?: System.currentTimeMillis(), avatarUrl = avatarUrl,
isMyTimeline = getTimelineRoomFor(circleId)?.roomId == roomId updatedTime = latestPreviewableEvent?.root?.originServerTs ?: System.currentTimeMillis(),
) isMyTimeline = getTimelineRoomFor(circleId)?.roomId == roomId,
\ No newline at end of file followInCirclesCount = followInCirclesCount
)
\ No newline at end of file
...@@ -8,5 +8,6 @@ data class FollowingListItem( ...@@ -8,5 +8,6 @@ data class FollowingListItem(
val ownerName: String, val ownerName: String,
val avatarUrl: String, val avatarUrl: String,
val updatedTime: Long, val updatedTime: Long,
val isMyTimeline: Boolean val isMyTimeline: Boolean,
val followInCirclesCount: Int
) : IdEntity<String> ) : IdEntity<String>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment