Merge pull request #3438 from element-hq/feature/fga/pinned_messages_actions

Update pinned message actions
This commit is contained in:
ganfra 2024-09-16 16:11:13 +02:00 committed by GitHub
commit 7fcccea43f
4 changed files with 2 additions and 40 deletions

View file

@ -195,9 +195,9 @@ private fun List<TimelineItemAction>.postFilter(content: TimelineItemEventConten
when (content) {
is TimelineItemCallNotifyContent,
is TimelineItemLegacyCallInviteContent,
is TimelineItemStateContent,
is TimelineItemStateContent -> action == TimelineItemAction.ViewSource
is TimelineItemRedactedContent -> {
action == TimelineItemAction.ViewSource
action == TimelineItemAction.ViewSource || action == TimelineItemAction.Unpin
}
else -> true
}

View file

@ -119,7 +119,6 @@ class PinnedMessagesListPresenter @AssistedInject constructor(
targetEvent: TimelineItem.Event,
) = launch {
when (action) {
TimelineItemAction.Redact -> handleActionRedact(targetEvent)
TimelineItemAction.ViewSource -> {
navigator.onShowEventDebugInfoClick(targetEvent.eventId, targetEvent.debugInfo)
}
@ -149,13 +148,6 @@ class PinnedMessagesListPresenter @AssistedInject constructor(
}
}
private suspend fun handleActionRedact(event: TimelineItem.Event) {
timelineProvider.invokeOnTimeline {
redactEvent(eventId = event.eventId, transactionId = event.transactionId, reason = null)
.onFailure { Timber.e(it) }
}
}
@Composable
private fun userEventPermissions(updateKey: Long): State<UserEventPermissions> {
return produceState(UserEventPermissions.DEFAULT, key1 = updateKey) {

View file

@ -17,7 +17,6 @@ class PinnedMessagesListTimelineActionPostProcessor : TimelineItemActionPostProc
actions.firstOrNull { it is TimelineItemAction.Unpin }?.let(::add)
actions.firstOrNull { it is TimelineItemAction.Forward }?.let(::add)
actions.firstOrNull { it is TimelineItemAction.ViewSource }?.let(::add)
actions.firstOrNull { it is TimelineItemAction.Redact }?.let(::add)
}
}
}