|
@@ -32,6 +32,13 @@ class ContactDetailViewController: UITableViewController {
|
|
|
return cell
|
|
|
}()
|
|
|
|
|
|
+ private lazy var copyToClipboardCell: ActionCell = {
|
|
|
+ let cell = ActionCell()
|
|
|
+ cell.actionTitle = String.localized("menu_copy_to_clipboard")
|
|
|
+ cell.actionColor = SystemColor.blue.uiColor
|
|
|
+ return cell
|
|
|
+ }()
|
|
|
+
|
|
|
private lazy var blockContactCell: ActionCell = {
|
|
|
let cell = ActionCell()
|
|
|
cell.actionTitle = viewModel.contact.isBlocked ? String.localized("menu_unblock_contact") : String.localized("menu_block_contact")
|
|
@@ -169,6 +176,8 @@ class ContactDetailViewController: UITableViewController {
|
|
|
return archiveChatCell
|
|
|
case .showEncrInfo:
|
|
|
return showEncrInfoCell
|
|
|
+ case .copyToClipboard:
|
|
|
+ return copyToClipboardCell
|
|
|
case .blockContact:
|
|
|
return blockContactCell
|
|
|
case .deleteChat:
|
|
@@ -254,6 +263,10 @@ class ContactDetailViewController: UITableViewController {
|
|
|
case .showEncrInfo:
|
|
|
tableView.deselectRow(at: indexPath, animated: false)
|
|
|
showEncrInfoAlert()
|
|
|
+ case .copyToClipboard:
|
|
|
+ tableView.deselectRow(at: indexPath, animated: true)
|
|
|
+ let pasteboard = UIPasteboard.general
|
|
|
+ pasteboard.string = viewModel.contact.email
|
|
|
case .blockContact:
|
|
|
tableView.deselectRow(at: indexPath, animated: false)
|
|
|
toggleBlockContact()
|