mirror of
https://github.com/basiliscos/syncspirit.git
synced 2026-06-01 17:47:32 +00:00
core, update diff-builder
This commit is contained in:
@@ -15,8 +15,10 @@
|
||||
#include "model/diff/modify/unshare_folder.h"
|
||||
#include "model/diff/modify/update_peer.h"
|
||||
#include "model/diff/modify/remove_peer.h"
|
||||
#include "model/diff/modify/update_contact.h"
|
||||
#include "model/diff/peer/cluster_update.h"
|
||||
#include "model/diff/peer/update_folder.h"
|
||||
#include "model/diff/peer/peer_state.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -177,6 +179,14 @@ diff_builder_t &diff_builder_t::remove_peer(const model::device_t &peer) noexcep
|
||||
return *this;
|
||||
}
|
||||
|
||||
diff_builder_t &diff_builder_t::update_state(const model::device_t &peer, const r::address_ptr_t &peer_addr,
|
||||
model::device_state_t state) noexcept {
|
||||
model::diff::cluster_diff_ptr_t diff;
|
||||
diff.reset(new model::diff::peer::peer_state_t(cluster, peer.device_id().get_sha256(), peer_addr, state));
|
||||
diffs.emplace_back(std::move(diff));
|
||||
return *this;
|
||||
}
|
||||
|
||||
diff_builder_t &diff_builder_t::append_block(const model::file_info_t &target, size_t block_index, std::string data,
|
||||
dispose_callback_t callback) noexcept {
|
||||
bdiffs.emplace_back(new diff::modify::append_block_t(target, block_index, std::move(data), std::move(callback)));
|
||||
|
||||
Reference in New Issue
Block a user