         //Check if the next and previous user are the same to see what kind of cell we will create
         if(indexPath.row > 0){
             
-            if(self.chatMessageData[indexPath.row]![0] == self.chatMessageData[indexPath.row - 1]![0]){
-                
+            if(self.chatMessageData[indexPath.row]!.userId == self.chatMessageData[indexPath.row - 1]!.userId){
+            
                 sameUser = true
                 
             }

        if let t = notification.userInfo!["t"]{
            type = t as! String
        }
        self.chatMessageData[self.chatMessageData.count] = [notification.userInfo!["u"]!["_id"]! as! String, notification.userInfo!["u"]!["username"]! as! String, notification.userInfo!["msg"]! as! String,type]
        
        let timestamp = [notification.userInfo!["ts"]!["$date"] as! NSNumber]
        let timestampInDouble = timestamp as! [Double]
        self.ts[self.ts.count] =  [timestampInDouble[0] / 1000]
        
        //Reloading data and if we are at the bottom scroll the view to the last row
        self.mainTableview.reloadData()

            }
            
            fullDetailsCell!.avatarImg.image = UIImage(named: "Default-Avatar")
            fullDetailsCell!.usernameLabel.text = self.chatMessageData[indexPath.row]!.username
            
            //Set color to #444444
            fullDetailsCell!.usernameLabel.textColor = UIColor.rocketMainFontColor()
            
            //Set the timestamp
            fullDetailsCell!.timeLabel.text = "\(dateFormatter.stringFromDate(NSDate(timeIntervalSince1970: (self.chatMessageData[indexPath.row]?.timestamp)!)))"
            fullDetailsCell!.timeLabel.textColor = UIColor.rocketTimestampColor()
            fullDetailsCell!.messageLabel.text = "has joined the channel"
            fullDetailsCell?.messageLabel.font = UIFont.italicSystemFontOfSize(15)
            fullDetailsCell!.messageLabel.textColor = UIColor.rocketSecondaryFontColor()
            
            return fullDetailsCell!
            
        }
        //If different user - return a non detailed cell
        else {
        
            var fullDetailsCell:MainTableViewCell? = mainTableview.dequeueReusableCellWithIdentifier("fullDetailsCell", forIndexPath: indexPath) as? MainTableViewCell
            
            
