mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Add "reply in thread" timeline item action menu entry.
This commit is contained in:
committed by
Stefan Ceriu
parent
09779a4e12
commit
3ef479305a
@@ -344,6 +344,7 @@ struct TimelineItemMenu_Previews: PreviewProvider, TestablePreview {
|
||||
pinnedEventIDs: [],
|
||||
isDM: true,
|
||||
isViewSourceEnabled: true,
|
||||
areThreadsEnabled: true,
|
||||
timelineKind: .live,
|
||||
emojiProvider: EmojiProvider(appSettings: ServiceLocator.shared.settings))
|
||||
guard let actions = provider.makeActions() else { return nil }
|
||||
|
||||
@@ -65,6 +65,7 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
|
||||
case copyPermalink
|
||||
case redact
|
||||
case reply(isThread: Bool)
|
||||
case replyInThread
|
||||
case forward(itemID: TimelineItemIdentifier)
|
||||
case viewSource
|
||||
case report
|
||||
@@ -159,6 +160,8 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
|
||||
Label(L10n.actionCopyLinkToMessage, icon: \.link)
|
||||
case .reply(let isThread):
|
||||
Label(isThread ? L10n.actionReplyInThread : L10n.actionReply, icon: \.reply)
|
||||
case .replyInThread:
|
||||
Label(L10n.actionReplyInThread, icon: \.threads)
|
||||
case .forward:
|
||||
Label(L10n.actionForward, icon: \.forward)
|
||||
case .redact:
|
||||
|
||||
@@ -16,6 +16,7 @@ struct TimelineItemMenuActionProvider {
|
||||
let pinnedEventIDs: Set<String>
|
||||
let isDM: Bool
|
||||
let isViewSourceEnabled: Bool
|
||||
let areThreadsEnabled: Bool
|
||||
let timelineKind: TimelineKind
|
||||
let emojiProvider: EmojiProviderProtocol
|
||||
|
||||
@@ -52,6 +53,10 @@ struct TimelineItemMenuActionProvider {
|
||||
} else {
|
||||
actions.append(.reply(isThread: false))
|
||||
}
|
||||
|
||||
if areThreadsEnabled, !timelineKind.isThread {
|
||||
actions.append(.replyInThread)
|
||||
}
|
||||
}
|
||||
|
||||
if item.isForwardable {
|
||||
|
||||
Reference in New Issue
Block a user