switch sides: windows

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-01-17 21:43:39 +08:00
parent e57949d472
commit c25796e44d
5 changed files with 27 additions and 24 deletions

View File

@@ -612,17 +612,3 @@ pub fn set_cur_session_id(id: String) {
*CUR_SESSION_ID.write().unwrap() = id;
}
}
pub fn switch_sides(peer_id: &str, uuid: &Bytes) {
if let Some(stream) = GLOBAL_EVENT_STREAM.read().unwrap().get(APP_TYPE_MAIN) {
if let Ok(uuid) = uuid::Uuid::from_slice(uuid.to_vec().as_ref()) {
let uuid = uuid.to_string();
let data = HashMap::from([
("name", "switch_sides"),
("peer_id", peer_id),
("uuid", &uuid),
]);
stream.add(serde_json::ser::to_string(&data).unwrap_or("".into()));
}
}
}