 import xmpp_messenger_ios
 import XMPPFramework
 
-class OpenChatsTableViewController: UITableViewController, OneRosterDelegate {
+class OpenChatsTableViewController: UITableViewController, OneRosterDelegate, NSFetchedResultsControllerDelegate {
 	
 	var chatList = NSArray()
 	

	
	override func viewDidLoad() {
		super.viewDidLoad()
		
		OneRoster.sharedInstance.delegate = self
	}
	
	override func viewWillAppear(animated: Bool) {
		super.viewWillAppear(animated)
		
		if OneChat.sharedInstance.isConnected() {
			//Set up online UI
		} else {
			performSegueWithIdentifier("One.HomeToSetting", sender: self)
		}
		
		tableView.rowHeight = 50

		
		configurePhotoForCell(cell!, user: user)
		
		print("unread messages = \(user.unreadMessages) -- isOnline ? \(user.isOnline())")
		
		cell?.imageView?.layer.cornerRadius = 24// CGRectGetWidth(cell!.frame) / 2
		cell?.imageView?.clipsToBounds = true
		
		return cell!
	}
	
