summaryrefslogtreecommitdiff
path: root/src/node/db
diff options
context:
space:
mode:
authorLuiza Pagliari <lpagliari@gmail.com>2017-05-18 18:52:14 -0300
committerLuiza Pagliari <lpagliari@gmail.com>2017-05-18 18:52:14 -0300
commitfc89034a555d1708a70f5007b4e6c0bc2641d8a4 (patch)
treece3d7966bb21788cbdb468b73ce647389ab6cb84 /src/node/db
parent8345fd15390499a170b524e43b60a088b83f823d (diff)
downloadetherpad-lite-fc89034a555d1708a70f5007b4e6c0bc2641d8a4.zip
[feat] New server-side hook: padCopy
Let plugins know when a pad is copied.
Diffstat (limited to 'src/node/db')
-rw-r--r--src/node/db/Pad.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js
index 5d26f470..d44cb7b3 100644
--- a/src/node/db/Pad.js
+++ b/src/node/db/Pad.js
@@ -592,6 +592,11 @@ Pad.prototype.copy = function copy(destinationID, force, callback) {
setTimeout(function(){
padManager.getPad(destinationID, null, callback) // this runs too early.
},10);
+ },
+ // let the plugins know the pad was copied
+ function(callback) {
+ hooks.callAll('padCopy', { 'originalPad': _this, 'destinationID': destinationID });
+ callback();
}
// series
], function(err)