|
@@ -428,9 +428,10 @@ class ChatViewController: MessagesViewController {
|
|
case NSSelectorFromString("messageStartChat:"):
|
|
case NSSelectorFromString("messageStartChat:"):
|
|
let msg = messageList[indexPath.section]
|
|
let msg = messageList[indexPath.section]
|
|
logger.info("message: Start Chat \(msg.messageId)")
|
|
logger.info("message: Start Chat \(msg.messageId)")
|
|
- _ = msg.createChat()
|
|
|
|
|
|
+ let chat = msg.createChat()
|
|
// TODO: figure out how to properly show the chat after creation
|
|
// TODO: figure out how to properly show the chat after creation
|
|
refreshMessages()
|
|
refreshMessages()
|
|
|
|
+ coordinator?.showChat(chatId: chat.id)
|
|
case NSSelectorFromString("messageBlock:"):
|
|
case NSSelectorFromString("messageBlock:"):
|
|
let msg = messageList[indexPath.section]
|
|
let msg = messageList[indexPath.section]
|
|
logger.info("message: Block \(msg.messageId)")
|
|
logger.info("message: Block \(msg.messageId)")
|
|
@@ -776,7 +777,7 @@ extension ChatViewController: MessagesLayoutDelegate {
|
|
|
|
|
|
// MARK: - MessageCellDelegate
|
|
// MARK: - MessageCellDelegate
|
|
extension ChatViewController: MessageCellDelegate {
|
|
extension ChatViewController: MessageCellDelegate {
|
|
- func didTapMessage(in cell: MessageCollectionViewCell) {
|
|
|
|
|
|
+ @objc func didTapMessage(in cell: MessageCollectionViewCell) {
|
|
if let indexPath = messagesCollectionView.indexPath(for: cell) {
|
|
if let indexPath = messagesCollectionView.indexPath(for: cell) {
|
|
let message = messageList[indexPath.section]
|
|
let message = messageList[indexPath.section]
|
|
|
|
|
|
@@ -811,7 +812,7 @@ extension ChatViewController: MessageCellDelegate {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- func didTapAvatar(in _: MessageCollectionViewCell) {
|
|
|
|
|
|
+ @objc func didTapAvatar(in _: MessageCollectionViewCell) {
|
|
logger.info("Avatar tapped")
|
|
logger.info("Avatar tapped")
|
|
}
|
|
}
|
|
|
|
|
|
@@ -822,6 +823,10 @@ extension ChatViewController: MessageCellDelegate {
|
|
@objc(didTapCellBottomLabelIn:) func didTapCellBottomLabel(in _: MessageCollectionViewCell) {
|
|
@objc(didTapCellBottomLabelIn:) func didTapCellBottomLabel(in _: MessageCollectionViewCell) {
|
|
print("Bottom label tapped")
|
|
print("Bottom label tapped")
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @objc func didTapBackground(in cell: MessageCollectionViewCell) {
|
|
|
|
+ print("background of message tapped")
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// MARK: - MessageLabelDelegate
|
|
// MARK: - MessageLabelDelegate
|