|
@@ -26,6 +26,10 @@ class ChatViewController: MessagesViewController {
|
|
var msgChangedObserver: Any?
|
|
var msgChangedObserver: Any?
|
|
var incomingMsgObserver: Any?
|
|
var incomingMsgObserver: Any?
|
|
|
|
|
|
|
|
+ lazy var navBarTap: UITapGestureRecognizer = {
|
|
|
|
+ return UITapGestureRecognizer(target: self, action: #selector(chatProfilePressed))
|
|
|
|
+ }()
|
|
|
|
+
|
|
var disableWriting = false
|
|
var disableWriting = false
|
|
|
|
|
|
var previewView: UIView?
|
|
var previewView: UIView?
|
|
@@ -47,8 +51,6 @@ class ChatViewController: MessagesViewController {
|
|
messagesCollectionView.register(CustomCell.self)
|
|
messagesCollectionView.register(CustomCell.self)
|
|
super.viewDidLoad()
|
|
super.viewDidLoad()
|
|
view.backgroundColor = DCColors.chatBackgroundColor
|
|
view.backgroundColor = DCColors.chatBackgroundColor
|
|
- let navBarTap = UITapGestureRecognizer(target: self, action: #selector(chatProfilePressed))
|
|
|
|
- navigationController?.navigationBar.addGestureRecognizer(navBarTap)
|
|
|
|
if !MRConfig.configured {
|
|
if !MRConfig.configured {
|
|
// TODO: display message about nothing being configured
|
|
// TODO: display message about nothing being configured
|
|
return
|
|
return
|
|
@@ -77,6 +79,10 @@ class ChatViewController: MessagesViewController {
|
|
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
super.viewWillAppear(animated)
|
|
super.viewWillAppear(animated)
|
|
|
|
+
|
|
|
|
+ // this will be removed in viewWillDisappear
|
|
|
|
+ navigationController?.navigationBar.addGestureRecognizer(navBarTap)
|
|
|
|
+
|
|
configureMessageMenu()
|
|
configureMessageMenu()
|
|
|
|
|
|
if #available(iOS 11.0, *) {
|
|
if #available(iOS 11.0, *) {
|
|
@@ -121,6 +127,9 @@ class ChatViewController: MessagesViewController {
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
super.viewWillDisappear(animated)
|
|
super.viewWillDisappear(animated)
|
|
|
|
|
|
|
|
+ // the navigationController will be used when chatDetail is pushed, so we have to remove that gestureRecognizer
|
|
|
|
+ navigationController?.navigationBar.removeGestureRecognizer(navBarTap)
|
|
|
|
+
|
|
let cnt = Int(dc_get_fresh_msg_cnt(mailboxPointer, UInt32(chatId)))
|
|
let cnt = Int(dc_get_fresh_msg_cnt(mailboxPointer, UInt32(chatId)))
|
|
logger.info("updating count for chat \(cnt)")
|
|
logger.info("updating count for chat \(cnt)")
|
|
UIApplication.shared.applicationIconBadgeNumber = cnt
|
|
UIApplication.shared.applicationIconBadgeNumber = cnt
|