ask for note at end of connection (#13499)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-11-13 23:35:40 +08:00
committed by GitHub
parent 13ee3e907d
commit 296c6df462
72 changed files with 932 additions and 200 deletions

View File

@@ -67,6 +67,8 @@ pub struct Session<T: InvokeUiSession> {
// Indicate whether the session is reconnected.
// Used to auto start file transfer after reconnection.
pub reconnect_count: Arc<AtomicUsize>,
pub last_audit_note: Arc<Mutex<String>>,
pub audit_guid: Arc<Mutex<String>>,
}
#[derive(Clone)]
@@ -355,7 +357,10 @@ impl<T: InvokeUiSession> Session<T> {
}
pub fn save_edge_scroll_edge_thickness(&self, value: i32) {
self.lc.write().unwrap().save_edge_scroll_edge_thickness(value);
self.lc
.write()
.unwrap()
.save_edge_scroll_edge_thickness(value);
}
pub fn save_flutter_option(&self, k: String, v: String) {
@@ -562,9 +567,6 @@ impl<T: InvokeUiSession> Session<T> {
}
pub fn get_audit_server(&self, typ: String) -> String {
if LocalConfig::get_option("access_token").is_empty() {
return "".to_owned();
}
crate::get_audit_server(
Config::get_option("api-server"),
Config::get_option("custom-rendezvous-server"),
@@ -576,6 +578,7 @@ impl<T: InvokeUiSession> Session<T> {
let url = self.get_audit_server("conn".to_string());
let id = self.get_id();
let session_id = self.lc.read().unwrap().session_id;
*self.last_audit_note.lock().unwrap() = note.clone();
std::thread::spawn(move || {
send_note(url, id, session_id, note);
});
@@ -1281,6 +1284,8 @@ impl<T: InvokeUiSession> Session<T> {
drop(connection_round_state_lock);
let cloned = self.clone();
*cloned.audit_guid.lock().unwrap() = String::new();
*cloned.last_audit_note.lock().unwrap() = String::new();
// override only if true
if true == force_relay {
self.lc.write().unwrap().force_relay = true;