disable interactions with deleted message in conversation screen

This commit is contained in:
Ryan Zhao 2021-08-05 13:36:56 +10:00
parent 6e45aed71b
commit e1b99be6f2
1 changed files with 1 additions and 0 deletions

View File

@ -365,6 +365,7 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
// Show the context menu if applicable
guard let index = viewItems.firstIndex(where: { $0 === viewItem }),
let cell = messagesTableView.cellForRow(at: IndexPath(row: index, section: 0)) as? VisibleMessageCell,
let message = viewItem.interaction as? TSMessage, !message.isDeleted,
let snapshot = cell.bubbleView.snapshotView(afterScreenUpdates: false), contextMenuWindow == nil,
!ContextMenuVC.actions(for: viewItem, delegate: self).isEmpty else { return }
UIImpactFeedbackGenerator(style: .heavy).impactOccurred()