             tableView.deselectRowAtIndexPath(indexPath, animated: true)
         }
 
-        if let friend = friendAtIndexPath(indexPath) {
-
-            searchController?.active = false
-
-            performSegueWithIdentifier("showProfile", sender: friend)
+        guard let section = Section(rawValue: indexPath.section) else {
+            return
+        }
+
+        switch section {
+
+        case .Local:
+
+            if let friend = friendAtIndexPath(indexPath) {
+
+                searchController?.active = false
+
+                performSegueWithIdentifier("showProfile", sender: friend)
+            }
+
+        case .Online:
+            break
         }
    }
 }


extension ContactsViewController: UITableViewDataSource, UITableViewDelegate {

    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return searchControllerIsActive ? (filteredFriends?.count ?? 0) : friends.count
    }

    private func friendAtIndexPath(indexPath: NSIndexPath) -> User? {


        // 超过一定人数才显示搜索框

        //if friends.count > Ruler.iPhoneVertical(6, 8, 10, 12).value {
        if friends.count > 0 {

            let searchController = UISearchController(searchResultsController: nil)
            searchController.delegate = self
