Skip to content

Commit 5bbe299

Browse files
committed
Use .value instead of .toString().
1 parent 0b5cb57 commit 5bbe299

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private fun RoomMemberActionsBottomSheet(
242242
)
243243
}
244244
Text(
245-
text = user.userId.toString(),
245+
text = user.userId.value,
246246
style = ElementTheme.typography.fontBodyLgRegular,
247247
color = ElementTheme.colors.textSecondary,
248248
maxLines = 1,

libraries/eventformatter/impl/src/test/kotlin/io/element/android/libraries/eventformatter/impl/DefaultBaseRoomLastMessageFormatterTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class DefaultBaseRoomLastMessageFormatterTest {
102102
val info = ImageInfo(null, null, null, null, null, null, null)
103103
val message = createRoomEvent(false, null, aStickerContent(body, info, aMediaSource(url = "url")))
104104
val result = formatter.format(message, false)
105-
val expectedBody = someoneElseId.toString() + ": Sticker (a sticker body)"
105+
val expectedBody = someoneElseId.value + ": Sticker (a sticker body)"
106106
assertThat(result.toString()).isEqualTo(expectedBody)
107107
}
108108

libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/core/MatrixPatterns.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ object MatrixPatterns {
151151
val urlMatch = match.groupValues[1]
152152
when (val permalink = permalinkParser.parse(urlMatch)) {
153153
is PermalinkData.UserLink -> {
154-
add(MatrixPatternResult(MatrixPatternType.USER_ID, permalink.userId.toString(), match.range.first, match.range.last + 1))
154+
add(MatrixPatternResult(MatrixPatternType.USER_ID, permalink.userId.value, match.range.first, match.range.last + 1))
155155
}
156156
is PermalinkData.RoomLink -> {
157157
when (permalink.roomIdOrAlias) {

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustBaseRoom.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,13 @@ class RustBaseRoom(
305305

306306
override suspend fun declineCall(notificationEventId: EventId): Result<Unit> = withContext(roomDispatcher) {
307307
runCatchingExceptions {
308-
innerRoom.declineCall(notificationEventId.toString())
308+
innerRoom.declineCall(notificationEventId.value)
309309
}
310310
}
311311

312312
override suspend fun subscribeToCallDecline(notificationEventId: EventId): Flow<UserId> = withContext(roomDispatcher) {
313313
mxCallbackFlow {
314-
innerRoom.subscribeToCallDeclineEvents(notificationEventId.toString(), object : CallDeclineListener {
314+
innerRoom.subscribeToCallDeclineEvents(notificationEventId.value, object : CallDeclineListener {
315315
override fun call(declinerUserId: String) {
316316
trySend(UserId(declinerUserId))
317317
}

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/join/AllowRule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fun RustAllowRule.map(): AllowRule {
2020

2121
fun AllowRule.map(): RustAllowRule {
2222
return when (this) {
23-
is AllowRule.RoomMembership -> RustAllowRule.RoomMembership(roomId.toString())
23+
is AllowRule.RoomMembership -> RustAllowRule.RoomMembership(roomId.value)
2424
is AllowRule.Custom -> RustAllowRule.Custom(json)
2525
}
2626
}

0 commit comments

Comments
 (0)