Use Clock (SDK API change)

This commit is contained in:
Benoit Marty 2022-05-03 09:32:44 +02:00 committed by Benoit Marty
parent 6a61e639e0
commit 45526c0e3a
2 changed files with 8 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import im.vector.app.core.epoxy.VectorEpoxyModel
import im.vector.app.core.files.LocalFilesHelper
import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.time.Clock
import im.vector.app.core.utils.DimensionConverter
import im.vector.app.core.utils.containsOnlyEmojis
import im.vector.app.features.home.room.detail.timeline.TimelineEventController
@ -142,6 +143,7 @@ class MessageItemFactory @Inject constructor(
private val lightweightSettingsStorage: LightweightSettingsStorage,
private val spanUtils: SpanUtils,
private val session: Session,
private val clock: Clock,
private val audioMessagePlaybackTracker: AudioMessagePlaybackTracker,
private val locationPinProvider: LocationPinProvider,
private val vectorPreferences: VectorPreferences,
@ -457,6 +459,7 @@ class MessageItemFactory @Inject constructor(
reactionsSummaryEvents = attributes.reactionsSummaryEvents,
)
)
.clock(clock)
.callback(callback)
.highlighted(highlight)
.leftGuideline(avatarSizeProvider.leftGuideline)

View File

@ -31,6 +31,7 @@ import com.airbnb.epoxy.EpoxyModelClass
import im.vector.app.R
import im.vector.app.core.epoxy.ClickListener
import im.vector.app.core.epoxy.onClick
import im.vector.app.core.time.Clock
import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.home.room.detail.RoomDetailAction
import im.vector.app.features.home.room.detail.timeline.MessageColorProvider
@ -47,6 +48,9 @@ abstract class VerificationRequestItem : AbsBaseMessageItem<VerificationRequestI
@EpoxyAttribute
lateinit var attributes: Attributes
@EpoxyAttribute
lateinit var clock: Clock
@EpoxyAttribute
var callback: TimelineEventController.Callback? = null
@ -107,7 +111,7 @@ abstract class VerificationRequestItem : AbsBaseMessageItem<VerificationRequestI
}
// Always hide buttons if request is too old
if (!VerificationService.isValidRequest(attributes.informationData.ageLocalTS)) {
if (!VerificationService.isValidRequest(attributes.informationData.ageLocalTS, clock.epochMillis())) {
holder.buttonBar.isVisible = false
}