[feat] New server-side hook: padCopy

Let plugins know when a pad is copied.
This commit is contained in:
Luiza Pagliari 2017-05-18 18:52:14 -03:00
parent 8345fd1539
commit fc89034a55
2 changed files with 24 additions and 1 deletions

View file

@ -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)