Skip to content

Commit 51a92eb

Browse files
committed
Avoid creating a new constant for the same goal.
1 parent 158e779 commit 51a92eb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

libraries/eventformatter/impl/src/main/kotlin/io/element/android/libraries/eventformatter/impl/DefaultRoomLatestEventFormatter.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
package io.element.android.libraries.eventformatter.impl
1010

1111
import dev.zacsweers.metro.ContributesBinding
12+
import io.element.android.libraries.core.extensions.DEFAULT_SAFE_LENGTH
1213
import io.element.android.libraries.di.SessionScope
1314
import io.element.android.libraries.eventformatter.api.RoomLatestEventFormatter
1415
import io.element.android.libraries.eventformatter.impl.mode.RenderingMode
@@ -54,11 +55,6 @@ class DefaultRoomLatestEventFormatter(
5455
private val stateContentFormatter: StateContentFormatter,
5556
private val permalinkParser: PermalinkParser,
5657
) : RoomLatestEventFormatter {
57-
companion object {
58-
// Max characters to display in the last message. This works around https://github.com/element-hq/element-x-android/issues/2105
59-
private const val MAX_SAFE_LENGTH = 500
60-
}
61-
6258
override fun format(
6359
latestEvent: LatestEventValue.Local,
6460
isDmRoom: Boolean,
@@ -121,7 +117,7 @@ class DefaultRoomLatestEventFormatter(
121117
}
122118
is LegacyCallInviteContent -> sp.getString(CommonStrings.common_unsupported_call)
123119
is CallNotifyContent -> sp.getString(CommonStrings.common_call_started)
124-
}?.take(MAX_SAFE_LENGTH)
120+
}?.take(DEFAULT_SAFE_LENGTH)
125121
}
126122

127123
private fun MessageContent.process(

0 commit comments

Comments
 (0)