Merge pull request #2699 from xavidotron/develop

Add author information to the context for padCreate and padUpdate hooks.
This commit is contained in:
John McLear 2015-06-22 10:56:56 +01:00
commit 6b40961fc8
2 changed files with 4 additions and 2 deletions

View File

@ -110,6 +110,7 @@ Called from: src/node/db/Pad.js
Things in context: Things in context:
1. pad - the pad instance 1. pad - the pad instance
2. author - the id of the author who created the pad
This hook gets called when a new pad was created. This hook gets called when a new pad was created.
@ -128,6 +129,7 @@ Called from: src/node/db/Pad.js
Things in context: Things in context:
1. pad - the pad instance 1. pad - the pad instance
2. author - the id of the author who updated the pad
This hook gets called when an existing pad was updated. This hook gets called when an existing pad was updated.

View File

@ -105,9 +105,9 @@ Pad.prototype.appendRevision = function appendRevision(aChangeset, author) {
authorManager.addPad(author, this.id); authorManager.addPad(author, this.id);
if (this.head == 0) { if (this.head == 0) {
hooks.callAll("padCreate", {'pad':this}); hooks.callAll("padCreate", {'pad':this, 'author': author});
} else { } else {
hooks.callAll("padUpdate", {'pad':this}); hooks.callAll("padUpdate", {'pad':this, 'author': author});
} }
}; };