mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
implement exit button as trait, set disconnect button status update by total
This commit is contained in:
parent
e1345a4922
commit
91cd9cbae9
4 changed files with 41 additions and 26 deletions
|
|
@ -124,6 +124,11 @@ impl Auth {
|
|||
.is_some_and(|auth| auth.profile_identity_id == profile_identity_id)
|
||||
}
|
||||
|
||||
/// Check request string matches condition
|
||||
pub fn total(&self, profile_identity_id: i64) -> usize {
|
||||
self.memory.total(profile_identity_id)
|
||||
}
|
||||
|
||||
/// Collect certificate scope vector from `Profile` database for `profile_identity_id`
|
||||
pub fn scope(&self, profile_identity_id: i64) -> Vec<String> {
|
||||
let mut scope = Vec::new();
|
||||
|
|
|
|||
|
|
@ -79,4 +79,17 @@ impl Memory {
|
|||
// Get first copy
|
||||
result.first().cloned()
|
||||
}
|
||||
|
||||
/// Get identity exactly match `scope`
|
||||
/// * [Client certificates specification](https://geminiprotocol.net/docs/protocol-specification.gmi#client-certificates)
|
||||
/// * see also parent `is_match_request`
|
||||
pub fn total(&self, profile_identity_id: i64) -> usize {
|
||||
let mut total = 0;
|
||||
for (_, _profile_identity_id) in self.index.borrow().iter() {
|
||||
if *_profile_identity_id == profile_identity_id {
|
||||
total += 1
|
||||
}
|
||||
}
|
||||
total
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue