mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-09 18:04:14 +00:00
add scope alias for Titan protocol
This commit is contained in:
parent
8534e5c510
commit
771908a334
@ -66,7 +66,7 @@ impl Memory {
|
|||||||
|
|
||||||
// Get all records starts with `scope`
|
// Get all records starts with `scope`
|
||||||
for (scope, &profile_identity_gemini_id) in self.index.borrow().iter() {
|
for (scope, &profile_identity_gemini_id) in self.index.borrow().iter() {
|
||||||
if request.starts_with(scope) {
|
if alias(request).starts_with(scope) {
|
||||||
result.push(Auth {
|
result.push(Auth {
|
||||||
profile_identity_gemini_id,
|
profile_identity_gemini_id,
|
||||||
scope: scope.clone(),
|
scope: scope.clone(),
|
||||||
@ -81,3 +81,12 @@ impl Memory {
|
|||||||
result.first().cloned()
|
result.first().cloned()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tools
|
||||||
|
|
||||||
|
// @TODO optional
|
||||||
|
fn alias(request: &str) -> String {
|
||||||
|
request
|
||||||
|
.replace("gemini://", "titan://")
|
||||||
|
.replace("titan://", "gemini://")
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user