fix dup on write

This commit is contained in:
Green Sky 2024-02-17 12:21:26 +01:00
parent 3d0863ff9a
commit 24dc5a03f3
No known key found for this signature in database

View File

@ -50,6 +50,12 @@ namespace Fragment::Components {
} // Fragment::Components } // Fragment::Components
void MessageFragmentStore::handleMessage(const Message3Handle& m) { void MessageFragmentStore::handleMessage(const Message3Handle& m) {
if (_fs_ignore_event) {
// message event because of us loading a fragment, ignore
// TODO: this barely makes a difference
return;
}
if (!static_cast<bool>(m)) { if (!static_cast<bool>(m)) {
return; // huh? return; // huh?
} }
@ -319,10 +325,15 @@ float MessageFragmentStore::tick(float time_delta) {
continue; continue;
} }
// require msg and file for now
if (!reg->any_of<Message::Components::MessageText, Message::Components::Transfer::FileInfo>(m)) { if (!reg->any_of<Message::Components::MessageText, Message::Components::Transfer::FileInfo>(m)) {
continue; continue;
} }
if (_fuid_save_queue.front().id != reg->get<Message::Components::FUID>(m).v) {
continue; // not ours
}
auto& j_entry = j.emplace_back(nlohmann::json::object()); auto& j_entry = j.emplace_back(nlohmann::json::object());
for (const auto& [type_id, storage] : reg->storage()) { for (const auto& [type_id, storage] : reg->storage()) {