1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Move Svelto/RC op ID copying logic into openjam servers

This commit is contained in:
NGnius (Graham)
2025-04-16 17:25:54 -04:00
parent 792a6362e3
commit 69c6c54650
7 changed files with 23 additions and 0 deletions

View File

@@ -7,3 +7,5 @@ pub use state::UserState;
pub mod persist;
pub use persist::user::{UserImpl, UserProvider, UserAuthenticator};
pub use persist::config::{ConfigImpl, ConfigProvider};
pub mod polariton;

View File

@@ -0,0 +1,2 @@
mod svelto_uuid_copy;
pub use svelto_uuid_copy::OpIdCopy;

View File

@@ -0,0 +1,15 @@
use polariton_server::operations::OperationModifier;
pub struct OpIdCopy;
impl OpIdCopy {
const SERVICE_MAPPING_KEY: u8 = 0;
}
impl <C: Clone + Send + Sync + 'static> OperationModifier<C> for OpIdCopy {
fn after(&self, req: &mut polariton::operation::OperationRequest<C>, resp: &mut polariton::operation::OperationResponse<C>) {
if let Some(svelto_service_id) = req.params.get(&Self::SERVICE_MAPPING_KEY) {
resp.params.insert(Self::SERVICE_MAPPING_KEY, svelto_service_id.to_owned());
}
}
}