Use the new setIsFavorite api
This commit is contained in:
+2
-7
@@ -435,14 +435,9 @@ class RustMatrixRoom(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun updateNotableTags(notableTags: RoomNotableTags): Result<Unit> = withContext(roomDispatcher) {
|
||||
override suspend fun setIsFavorite(isFavorite: Boolean): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatching {
|
||||
Timber.i("Update notable tags with : $notableTags")
|
||||
innerRoom.updateNotableTags(notableTags.map())
|
||||
}.onFailure {
|
||||
Timber.w("Failed to update notable tags: $it")
|
||||
}.onSuccess {
|
||||
Timber.i("Successfully updated notable tags")
|
||||
innerRoom.setIsFavorite(isFavorite, null)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -20,9 +20,11 @@ import io.element.android.libraries.matrix.api.room.tags.RoomNotableTags
|
||||
import uniffi.matrix_sdk_base.RoomNotableTags as RustRoomNotableTags
|
||||
|
||||
fun RustRoomNotableTags.map() = RoomNotableTags(
|
||||
isFavorite = isFavorite
|
||||
isFavorite = isFavorite,
|
||||
isLowPriority = isLowPriority
|
||||
)
|
||||
|
||||
fun RoomNotableTags.map() = RustRoomNotableTags(
|
||||
isFavorite = isFavorite
|
||||
isFavorite = isFavorite,
|
||||
isLowPriority = isLowPriority
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user