tor: inverse check skip send to send tor

This commit is contained in:
ardocrat
2026-06-23 14:17:49 +03:00
parent 3f89cbc663
commit 18060987ef
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -373,7 +373,7 @@ where
Some(a) => {
let tc = self.tor_config.lock();
let can_send = if let Some(tc) = tc.as_ref() {
tc.skip_send(None)
tc.send_tor(None)
} else {
false
};
+2 -2
View File
@@ -677,7 +677,7 @@ where
let tor_config_lock = self.tor_config.lock();
let tc = tor_config_lock.clone();
let can_send = if let Some(tc) = tc.as_ref() {
tc.skip_send(sa.skip_tor)
tc.send_tor(sa.skip_tor)
} else {
false
};
@@ -837,7 +837,7 @@ where
let tor_config_lock = self.tor_config.lock();
let tc = tor_config_lock.clone();
let can_send = if let Some(tc) = tc.as_ref() {
tc.skip_send(sa.skip_tor)
tc.send_tor(sa.skip_tor)
} else {
false
};
+4 -4
View File
@@ -195,12 +195,12 @@ impl Default for TorConfig {
}
impl TorConfig {
/// Check if attempt to send over Tor must be skipped using provided possible argument at priority.
pub fn skip_send(&self, skip_arg: Option<bool>) -> bool {
/// Check if attempt to send over Tor is needed using provided possible argument at priority.
pub fn send_tor(&self, skip_arg: Option<bool>) -> bool {
if let Some(skip_tor) = skip_arg {
return skip_tor;
return !skip_tor;
}
self.skip_send_attempt.unwrap_or(false)
!self.skip_send_attempt.unwrap_or(false)
}
}
+3 -3
View File
@@ -450,7 +450,7 @@ where
};
let can_send = if let Some(tc) = tor_config.as_ref() {
tc.skip_send(args.skip_tor)
tc.send_tor(args.skip_tor)
} else {
false
};
@@ -707,7 +707,7 @@ where
};
let can_send = if let Some(tc) = tor_config.as_ref() {
tc.skip_send(args.skip_tor)
tc.send_tor(args.skip_tor)
} else {
false
};
@@ -1050,7 +1050,7 @@ where
};
let can_send = if let Some(tc) = tor_config.as_ref() {
tc.skip_send(args.skip_tor)
tc.send_tor(args.skip_tor)
} else {
false
};