Feature: Copy Pad without history (#4295)

New feature to copy a pad without copying entire history.  This is useful to perform a low CPU intensive operation while still copying current pad state.
This commit is contained in:
Joas Souza 2020-09-16 15:24:09 -03:00 committed by GitHub
parent b80a37173e
commit 8c04fe8775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 259 additions and 36 deletions

View file

@ -597,6 +597,21 @@ exports.copyPad = async function(sourceID, destinationID, force)
await pad.copy(destinationID, force);
}
/**
copyPadWithoutHistory(sourceID, destinationID[, force=false]) copies a pad. If force is true,
the destination will be overwritten if it exists.
Example returns:
{code: 0, message:"ok", data: {padID: destinationID}}
{code: 1, message:"padID does not exist", data: null}
*/
exports.copyPadWithoutHistory = async function(sourceID, destinationID, force)
{
let pad = await getPadSafe(sourceID, true);
await pad.copyPadWithoutHistory(destinationID, force);
}
/**
movePad(sourceID, destinationID[, force=false]) moves a pad. If force is true,
the destination will be overwritten if it exists.