JMAP Registry API implementation - part 5

This commit is contained in:
mdecimus
2026-02-27 20:10:24 +01:00
parent e24b595a16
commit 07d5748f6b
35 changed files with 1460 additions and 316 deletions

View File

@@ -188,11 +188,11 @@ impl SpamClassifier for Server {
let mut duplicate_samples = Vec::new();
let mut remove_entries = false;
let object_id = ObjectType::SpamTrainingSample.to_id();
let from_key = ValueKey::from(ValueClass::Registry(RegistryClass::Id {
let from_key = ValueKey::from(ValueClass::Registry(RegistryClass::Item {
object_id,
item_id: trainer.last_id + 1,
}));
let to_key = ValueKey::from(ValueClass::Registry(RegistryClass::Id {
let to_key = ValueKey::from(ValueClass::Registry(RegistryClass::Item {
object_id,
item_id: u64::MAX,
}));
@@ -564,18 +564,17 @@ impl SpamClassifier for Server {
hash: sample.sample.hash,
to: BlobLink::Temporary { until },
})
.clear(ValueClass::Registry(RegistryClass::Id {
.clear(ValueClass::Registry(RegistryClass::Item {
object_id,
item_id: sample.id,
}));
if sample.sample.account_id != u32::MAX {
batch.clear(ValueClass::Registry(RegistryClass::Index {
}))
.clear(ValueClass::Registry(RegistryClass::Index {
index_id: Property::AccountId.to_id(),
object_id,
item_id: sample.id,
key: sample.sample.account_id.serialize(),
key: (sample.sample.account_id as u64).serialize(),
}));
}
if batch.is_large_batch() {
self.store()
.write(batch.build_all())