Skip to content

Commit 6cf64b2

Browse files
committed
Pinned event : branch pinEvent action
1 parent 210e209 commit 6cf64b2

File tree

1 file changed

+8
-1
lines changed
  • features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl

1 file changed

+8
-1
lines changed

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,14 @@ class MessagesPresenter @AssistedInject constructor(
280280
TimelineItemAction.Forward -> handleForwardAction(targetEvent)
281281
TimelineItemAction.ReportContent -> handleReportAction(targetEvent)
282282
TimelineItemAction.EndPoll -> handleEndPollAction(targetEvent, timelineState)
283-
TimelineItemAction.Pin -> Timber.d("Pin action not implemented")
283+
TimelineItemAction.Pin -> handlePinAction(targetEvent)
284+
}
285+
}
286+
287+
private suspend fun handlePinAction(targetEvent: TimelineItem.Event) {
288+
if (targetEvent.eventId == null) return
289+
timelineController.invokeOnCurrentTimeline {
290+
pinEvent(targetEvent.eventId)
284291
}
285292
}
286293

0 commit comments

Comments
 (0)