Do not send unnecessary update files on remote location change.

GitOrigin-RevId: 2f76e0a82946354736849edad3fcc3d80f760658
This commit is contained in:
levlam 2019-01-24 22:52:24 +03:00
parent 4eec01cb49
commit 9d9b0cd2ad

View File

@ -147,11 +147,12 @@ void FileNode::set_remote_location(const RemoteFileLocation &remote, FileLocatio
}
if (remote_ == remote) {
if (remote_.type() == RemoteFileLocation::Type::Full) {
if (remote_.full().get_access_hash() == remote.full().get_access_hash() &&
remote_.full().has_file_reference() == remote.full().has_file_reference()) {
return;
if (remote_.full().get_access_hash() != remote.full().get_access_hash() ||
remote_.full().get_file_reference() != remote.full().get_file_reference()) {
remote_ = remote;
remote_source_ = source;
on_pmc_changed();
}
} else {
return;
}
}