|
@@ -268,7 +268,7 @@ class ChatViewController: MessagesViewController {
|
|
if disableWriting {
|
|
if disableWriting {
|
|
menuItems = [
|
|
menuItems = [
|
|
UIMenuItem(title: String.localized("start_chat"), action: #selector(MessageCollectionViewCell.messageStartChat(_:))),
|
|
UIMenuItem(title: String.localized("start_chat"), action: #selector(MessageCollectionViewCell.messageStartChat(_:))),
|
|
- UIMenuItem(title: String.localized("cancel"), action: #selector(MessageCollectionViewCell.messageDismiss(_:))),
|
|
|
|
|
|
+ UIMenuItem(title: String.localized("delete"), action: #selector(MessageCollectionViewCell.messageDelete(_:))),
|
|
UIMenuItem(title: String.localized("menu_block_contact"), action: #selector(MessageCollectionViewCell.messageBlock(_:))),
|
|
UIMenuItem(title: String.localized("menu_block_contact"), action: #selector(MessageCollectionViewCell.messageBlock(_:))),
|
|
]
|
|
]
|
|
} else {
|
|
} else {
|
|
@@ -444,7 +444,6 @@ class ChatViewController: MessagesViewController {
|
|
if action == NSSelectorFromString("messageInfo:") ||
|
|
if action == NSSelectorFromString("messageInfo:") ||
|
|
action == NSSelectorFromString("messageDelete:") ||
|
|
action == NSSelectorFromString("messageDelete:") ||
|
|
action == NSSelectorFromString("messageBlock:") ||
|
|
action == NSSelectorFromString("messageBlock:") ||
|
|
- action == NSSelectorFromString("messageDismiss:") ||
|
|
|
|
action == NSSelectorFromString("messageStartChat:") {
|
|
action == NSSelectorFromString("messageStartChat:") {
|
|
return true
|
|
return true
|
|
} else {
|
|
} else {
|
|
@@ -478,12 +477,6 @@ class ChatViewController: MessagesViewController {
|
|
logger.info("message: Block \(msg.messageId)")
|
|
logger.info("message: Block \(msg.messageId)")
|
|
msg.fromContact.block()
|
|
msg.fromContact.block()
|
|
|
|
|
|
- refreshMessages()
|
|
|
|
- case NSSelectorFromString("messageDismiss:"):
|
|
|
|
- let msg = messageList[indexPath.section]
|
|
|
|
- logger.info("message: Dismiss \(msg.messageId)")
|
|
|
|
- msg.fromContact.marknoticed()
|
|
|
|
-
|
|
|
|
refreshMessages()
|
|
refreshMessages()
|
|
default:
|
|
default:
|
|
super.collectionView(collectionView, performAction: action, forItemAt: indexPath, withSender: sender)
|
|
super.collectionView(collectionView, performAction: action, forItemAt: indexPath, withSender: sender)
|
|
@@ -1159,19 +1152,6 @@ extension MessageCollectionViewCell {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @objc func messageDismiss(_ sender: Any?) {
|
|
|
|
- // Get the collectionView
|
|
|
|
- if let collectionView = self.superview as? UICollectionView {
|
|
|
|
- // Get indexPath
|
|
|
|
- if let indexPath = collectionView.indexPath(for: self) {
|
|
|
|
- // Trigger action
|
|
|
|
- collectionView.delegate?.collectionView?(collectionView,
|
|
|
|
- performAction: #selector(MessageCollectionViewCell.messageDismiss(_:)),
|
|
|
|
- forItemAt: indexPath, withSender: sender)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@objc func messageStartChat(_ sender: Any?) {
|
|
@objc func messageStartChat(_ sender: Any?) {
|
|
// Get the collectionView
|
|
// Get the collectionView
|
|
if let collectionView = self.superview as? UICollectionView {
|
|
if let collectionView = self.superview as? UICollectionView {
|