mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-08 01:11:28 +03:00
This reverts commit 011647511c.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use super::*;
|
||||
pub use crate::clipboard::{
|
||||
check_clipboard, get_cache_msg, ClipboardContext, ClipboardSide,
|
||||
CLIPBOARD_INTERVAL as INTERVAL, CLIPBOARD_NAME as NAME,
|
||||
check_clipboard, ClipboardContext, CLIPBOARD_INTERVAL as INTERVAL, CLIPBOARD_NAME as NAME,
|
||||
CONTENT,
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
@@ -11,7 +11,7 @@ struct State {
|
||||
|
||||
impl super::service::Reset for State {
|
||||
fn reset(&mut self) {
|
||||
crate::clipboard::reset_cache();
|
||||
*CONTENT.lock().unwrap() = Default::default();
|
||||
self.ctx = None;
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ pub fn new() -> GenericService {
|
||||
}
|
||||
|
||||
fn run(sp: EmptyExtraFieldService, state: &mut State) -> ResultType<()> {
|
||||
if let Some(msg) = check_clipboard(&mut state.ctx, ClipboardSide::Host) {
|
||||
if let Some(msg) = check_clipboard(&mut state.ctx, None) {
|
||||
sp.send(msg);
|
||||
}
|
||||
sp.snapshot(|sps| {
|
||||
// Just create a message with multi clipboards here
|
||||
// The actual peer version and peer platform will be checked again before sending.
|
||||
if let Some(msg) = get_cache_msg("1.2.7", "Windows") {
|
||||
sps.send_shared(Arc::new(msg));
|
||||
let data = CONTENT.lock().unwrap().clone();
|
||||
if !data.is_empty() {
|
||||
let msg_out = data.create_msg();
|
||||
sps.send_shared(Arc::new(msg_out));
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user