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

Change sdk version to 1.4.27

parent 4bdeb105
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//Matrix
implementation 'org.matrix.android:matrix-sdk-android:1.4.17'
implementation 'org.matrix.android:matrix-sdk-android:1.4.27'
//Kotlin
implementation "androidx.core:core-ktx:1.8.0"
......
......@@ -2,6 +2,7 @@ package org.futo.circles.extensions
import org.futo.circles.R
import org.futo.circles.provider.MatrixSessionProvider
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.getRoom
......@@ -63,7 +64,7 @@ fun PowerLevelsContent.getCurrentUserPowerLevel(): Int {
fun getPowerLevelContent(roomId: String): PowerLevelsContent? {
val session = MatrixSessionProvider.currentSession ?: return null
val room = session.getRoom(roomId) ?: return null
return room.getStateEvent(EventType.STATE_ROOM_POWER_LEVELS)?.content.toModel<PowerLevelsContent>()
return room.getStateEvent(EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.IsEmpty)?.content.toModel<PowerLevelsContent>()
}
fun getCurrentUserPowerLevel(roomId: String): Int {
......
......@@ -3,6 +3,8 @@ package org.futo.circles.feature.room.manage_members
import android.content.Context
import androidx.lifecycle.asFlow
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.*
import org.futo.circles.R
import org.futo.circles.core.ExpandableItemsDataSource
import org.futo.circles.extensions.createResult
......@@ -11,8 +13,6 @@ import org.futo.circles.mapping.toGroupMemberListItem
import org.futo.circles.mapping.toInvitedUserListItem
import org.futo.circles.model.*
import org.futo.circles.provider.MatrixSessionProvider
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.*
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toContent
......@@ -28,7 +28,7 @@ class ManageMembersDataSource(
private val roomId: String,
private val type: CircleRoomTypeArg,
private val context: Context
):ExpandableItemsDataSource {
) : ExpandableItemsDataSource {
private val session = MatrixSessionProvider.currentSession
private val room = session?.getRoom(roomId)
......@@ -62,7 +62,9 @@ class ManageMembersDataSource(
}
private fun getRoomMembersRoleFlow(): Flow<PowerLevelsContent> {
return room?.stateService()?.getStateEventLive(EventType.STATE_ROOM_POWER_LEVELS)?.asFlow()
return room?.stateService()
?.getStateEventLive(EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.IsEmpty)
?.asFlow()
?.mapNotNull { it.getOrNull()?.content.toModel<PowerLevelsContent>() } ?: flowOf()
}
......
......@@ -9,6 +9,7 @@ import org.futo.circles.model.Post
import org.futo.circles.provider.MatrixSessionProvider
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.mapNotNull
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.getRoom
......@@ -30,7 +31,7 @@ class TimelineDataSource(
val roomTitleLiveData = room?.getRoomSummaryLive()?.map { it.getOrNull()?.nameOrId() }
val timelineEventsLiveData = MutableLiveData<List<Post>>()
val accessLevelFlow =
room?.stateService()?.getStateEventLive(EventType.STATE_ROOM_POWER_LEVELS)?.asFlow()
room?.stateService()?.getStateEventLive(EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.IsEmpty)?.asFlow()
?.mapNotNull { it.getOrNull()?.content.toModel<PowerLevelsContent>() } ?: flowOf()
private var timelines: MutableList<Timeline> = mutableListOf()
......
......@@ -30,7 +30,7 @@ object MatrixSessionProvider {
private fun startSession(session: Session, listener: Session.Listener? = null) {
listener?.let { session.addListener(it) }
currentSession = session.apply { open(); startSync(true) }
currentSession = session.apply { open(); syncService().startSync(true) }
}
suspend fun awaitForSessionStart(session: Session) =
......
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