mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Show Only Retry Decryption and View Source for Unencrypted messages (#1202)
* show only retryDecryption for unencrypted message * fix
This commit is contained in:
@@ -353,11 +353,19 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
// Don't show a context menu for non-event based items.
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
if timelineItem is StateRoomTimelineItem {
|
||||
// Don't show a context menu for state events.
|
||||
return nil
|
||||
}
|
||||
|
||||
var debugActions: [TimelineItemMenuAction] = appSettings.canShowDeveloperOptions ? [.viewSource] : []
|
||||
|
||||
if let encryptedItem = timelineItem as? EncryptedRoomTimelineItem,
|
||||
case let .megolmV1AesSha2(sessionID) = encryptedItem.encryptionType {
|
||||
debugActions.append(.retryDecryption(sessionID: sessionID))
|
||||
return .init(actions: [], debugActions: debugActions)
|
||||
}
|
||||
|
||||
var actions: [TimelineItemMenuAction] = [
|
||||
.reply
|
||||
@@ -382,13 +390,6 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
} else {
|
||||
actions.append(.report)
|
||||
}
|
||||
|
||||
var debugActions: [TimelineItemMenuAction] = appSettings.canShowDeveloperOptions ? [.viewSource] : []
|
||||
|
||||
if let item = timelineItem as? EncryptedRoomTimelineItem,
|
||||
case let .megolmV1AesSha2(sessionID) = item.encryptionType {
|
||||
debugActions.append(.retryDecryption(sessionID: sessionID))
|
||||
}
|
||||
|
||||
if item.hasFailedToSend {
|
||||
actions = actions.filter(\.canAppearInFailedEcho)
|
||||
|
||||
Reference in New Issue
Block a user