From 6cf64b263e2a905e5bce40b071533d55c0f25073 Mon Sep 17 00:00:00 2001 From: ganfra Date: Mon, 29 Jul 2024 13:43:57 +0200 Subject: [PATCH] Pinned event : branch pinEvent action --- .../android/features/messages/impl/MessagesPresenter.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt index c86b587063..12b7bf9f50 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt @@ -280,7 +280,14 @@ class MessagesPresenter @AssistedInject constructor( TimelineItemAction.Forward -> handleForwardAction(targetEvent) TimelineItemAction.ReportContent -> handleReportAction(targetEvent) TimelineItemAction.EndPoll -> handleEndPollAction(targetEvent, timelineState) - TimelineItemAction.Pin -> Timber.d("Pin action not implemented") + TimelineItemAction.Pin -> handlePinAction(targetEvent) + } + } + + private suspend fun handlePinAction(targetEvent: TimelineItem.Event) { + if (targetEvent.eventId == null) return + timelineController.invokeOnCurrentTimeline { + pinEvent(targetEvent.eventId) } }