         }
 
         func needsUnreadSeparator(_ obj: ChatData) -> Bool {
-            if let currentUser = AuthManager.currentUser(), let objUser = obj.message?.user, currentUser != objUser {
+            if let currentUser = AuthManager.currentUser(), let objUser = obj.message?.validated()?.user, currentUser != objUser {
                 if obj.timestamp > lastSeen && !unreadSeparator {
                     unreadSeparator = true
                     return true


    func oldestMessage() -> Message? {
        for obj in data where obj.type == .message {
            return obj.message
        }

        return nil


    func update(_ message: Message) -> Int {
        for (idx, obj) in data.enumerated()
            where obj.message?.validated()?.identifier == message.identifier {
                invalidateLayout(for: obj.identifier)

                let objMessage = obj.message?.validated()

                if objMessage?.updatedAt?.timeIntervalSince1970 == message.updatedAt?.timeIntervalSince1970 && objMessage?.markedForDeletion == message.markedForDeletion {
                   return -1
                }

                if let oldMessage = objMessage {
                    if !(oldMessage == message) {
                        MessageTextCacheManager.shared.update(for: message, with: nil)
                    }
