 
     fileprivate var tableViewTapGestureRecognizer: UITapGestureRecognizer!
 
-    fileprivate var newMessageViewTopConstraint: Constraint!
-    fileprivate var chatInputViewBottomConstraint: Constraint!
+    fileprivate var newMessageViewTopConstraint: Constraint?
+    fileprivate var chatInputViewBottomConstraint: Constraint?
 
     fileprivate var newMessagesViewVisible = false
 
     /// Index path for cell with UIMenu presented.
     fileprivate var selectedMenuIndexPath: IndexPath?
+
+    fileprivate var disableNextInputViewAnimation = false
 
     init(theme: Theme, chat: OCTChat, submanagerChats: OCTSubmanagerChats, submanagerObjects: OCTSubmanagerObjects, submanagerFiles: OCTSubmanagerFiles, delegate: ChatPrivateControllerDelegate) {
         self.theme = theme


        UIView.animate(withDuration: Constants.NewMessageViewAnimationDuration, animations: {
            if show {
                self.newMessageViewTopConstraint.update(offset: Constants.NewMessageViewTopOffset - self.newMessagesView.frame.size.height)
            }
            else {
                self.newMessageViewTopConstraint.update(offset: 0.0)
            }

            self.view.layoutIfNeeded()

        super.viewDidAppear(animated)

        if !chatInputView.text.isEmpty {
            disableNextInputViewAnimation = true
            _ = chatInputView.becomeFirstResponder()
        }
    }
