refactor set_peer_info

This commit is contained in:
csf
2022-09-01 16:21:41 +08:00
parent 41a53e4983
commit 2891c1b148
5 changed files with 59 additions and 136 deletions

View File

@@ -1278,13 +1278,13 @@ impl LoginConfigHandler {
///
/// * `username` - The name of the peer.
/// * `pi` - The peer info.
pub fn handle_peer_info(&mut self, username: String, pi: PeerInfo) {
pub fn handle_peer_info(&mut self, pi: PeerInfo) {
if !pi.version.is_empty() {
self.version = hbb_common::get_version_number(&pi.version);
}
self.features = pi.features.into_option();
let serde = PeerInfoSerde {
username,
username: pi.username.clone(),
hostname: pi.hostname.clone(),
platform: pi.platform.clone(),
};