diff --git a/Yep/Services/YepService.swift b/Yep/Services/YepService.swift index 1fac5bd7..4d609903 100644 --- a/Yep/Services/YepService.swift +++ b/Yep/Services/YepService.swift @@ -1212,8 +1212,9 @@ func sendMessageWithMediaType(mediaType: MessageMediaType, inFilePath filePath: message.sendState = MessageSendState.Successed.rawValue realm.commitWrite() - NSNotificationCenter.defaultCenter().postNotificationName(MessageNotification.MessageStateChanged, object: nil) completion(success: true) + + NSNotificationCenter.defaultCenter().postNotificationName(MessageNotification.MessageStateChanged, object: nil) } }) @@ -1270,8 +1271,10 @@ func sendMessageWithMediaType(mediaType: MessageMediaType, inFilePath filePath: // var operation = MessageStateOperation(type: .Sent, messageID: messageID) // // ConversationOperationQueue.sharedManager.addNewQperationQueue(operation) - + completion(success: true) + + NSNotificationCenter.defaultCenter().postNotificationName(MessageNotification.MessageStateChanged, object: nil) } }) diff --git a/Yep/Views/Cells/ChatRightImage/ChatRightImageCell.swift b/Yep/Views/Cells/ChatRightImage/ChatRightImageCell.swift index 98661565..5493363e 100644 --- a/Yep/Views/Cells/ChatRightImage/ChatRightImageCell.swift +++ b/Yep/Views/Cells/ChatRightImage/ChatRightImageCell.swift @@ -8,7 +8,7 @@ import UIKit -class ChatRightImageCell: UICollectionViewCell { +class ChatRightImageCell: ChatRightBaseCell { @IBOutlet weak var avatarImageView: UIImageView! @IBOutlet weak var avatarImageViewWidthConstraint: NSLayoutConstraint! @@ -17,20 +17,14 @@ class ChatRightImageCell: UICollectionViewCell { @IBOutlet weak var messageImageViewWidthConstrint: NSLayoutConstraint! - @IBOutlet weak var dotImageView: UIImageView! - @IBOutlet weak var gapBetweenDotImageViewAndBubbleConstraint: NSLayoutConstraint! - typealias MediaTapAction = () -> Void var mediaTapAction: MediaTapAction? - override func awakeFromNib() { super.awakeFromNib() avatarImageViewWidthConstraint.constant = YepConfig.chatCellAvatarSize() - gapBetweenDotImageViewAndBubbleConstraint.constant = YepConfig.ChatCell.gapBetweenDotImageViewAndBubble - messageImageView.tintColor = UIColor.rightBubbleTintColor() messageImageView.userInteractionEnabled = true @@ -44,6 +38,8 @@ class ChatRightImageCell: UICollectionViewCell { func configureWithMessage(message: Message, messageImagePreferredWidth: CGFloat, messageImagePreferredHeight: CGFloat, messageImagePreferredAspectRatio: CGFloat, mediaTapAction: MediaTapAction?) { + self.message = message + self.mediaTapAction = mediaTapAction if let sender = message.fromFriend {