Use the new setIsFavorite api
This commit is contained in:
parent
d9017a098c
commit
f3c1eb6738
7 changed files with 28 additions and 27 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue