basically working, but some dup glitch is still there

This commit is contained in:
2024-02-17 11:49:03 +01:00
parent 97aedca844
commit 3d0863ff9a
5 changed files with 203 additions and 42 deletions

View File

@@ -36,7 +36,7 @@ bool MessageSerializerCallbacks::component_emplace_or_replace_json<Message::Comp
return true;
}
const auto id = static_cast<std::vector<uint8_t>>(j);
const auto id = static_cast<std::vector<uint8_t>>(j.is_binary()?j:j["bytes"]);
// TODO: id lookup table, this is very inefficent
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {
@@ -79,7 +79,7 @@ bool MessageSerializerCallbacks::component_emplace_or_replace_json<Message::Comp
return true;
}
const auto id = static_cast<std::vector<uint8_t>>(j);
const auto id = static_cast<std::vector<uint8_t>>(j.is_binary()?j:j["bytes"]);
// TODO: id lookup table, this is very inefficent
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {