 
         // 预先生成头像和最近消息图片的缓存
         cacheInAdvance()
+
+        isFirstAppear = false
     }
 
     override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {


                let haveOneToOneUnreadMessages = countOfUnreadMessagesInRealm(realm, withConversationType: ConversationType.OneToOne) > 0

                strongSelf.haveOneToOneUnreadMessages = haveOneToOneUnreadMessages
                strongSelf.haveUnreadMessages = haveOneToOneUnreadMessages || (countOfUnreadMessagesInRealm(realm) > 0)

                strongSelf.noConversation = countOfConversationsInRealm(realm) == 0

            }
        }
    }

    var isFirstAppear = true
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        
        // refresh for unread messages

        if !isFirstAppear {
            reloadConversationsTableView()
        }
    }

    override func viewDidAppear(animated: Bool) {
