             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
         }
    }
 }


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

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

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

            return
        }

        guard let section = Section(rawValue: indexPath.section) else {
            return
        }

        switch section {

        case .Local:

            guard let friend = friendAtIndexPath(indexPath) else {
                return
            }

            let userAvatar = UserAvatar(userID: friend.userID, avatarURLString: friend.avatarURLString, avatarStyle: miniAvatarStyle)
            cell.avatarImageView.navi_setAvatar(userAvatar, withFadeTransitionDuration: avatarFadeTransitionDuration)

            cell.nameLabel.text = friend.nickname

            if let badge = BadgeView.Badge(rawValue: friend.badge) {
                cell.badgeImageView.image = badge.image
                cell.badgeImageView.tintColor = badge.color
            } else {
                cell.badgeImageView.image = nil
            }

            cell.joinedDateLabel.text = friend.introduction
            cell.lastTimeSeenLabel.text = String(format:NSLocalizedString("Last seen %@", comment: ""), NSDate(timeIntervalSince1970: friend.lastSignInUnixTime).timeAgo.lowercaseString)

        case .Online:
            break
        }
    }

    func tableView(tableView: UITableView, didEndDisplayingCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
