                 }
         }
     }
+    
     
     func updateTotalAndUnreadCount() {
         self.channelRef?.runTransactionBlock({

            }
            })
    }
    
    func updateReadMsgCount(forRefrence reference: Firebase) {
        reference.runTransactionBlock({ (messageData) -> FTransactionResult! in

                        (currentData:FMutableData!) in
                        guard let userName = self.userName else {return FTransactionResult.successWithValue(currentData)}
                        let unreadCountData = currentData.childDataByAppendingPath("\(userName)_unreadCount")
                        //                        let totalCountData = currentData.childDataByAppendingPath("\(self.userName ?? "")_totalCount")
                        //
                        //                        var totalCount = totalCountData.value as? Int
                        //                        if totalCount == nil {
                        //                            totalCount = 0
                        //                        }
                        //                        totalCountData.value = totalCount! - 1
                        
                        var unreadCount = unreadCountData.value as? Int
                        if unreadCount == nil {
