From a4fe0d0dc8a80662606af17461793205d128ad22 Mon Sep 17 00:00:00 2001 From: Xavid Date: Sun, 21 Jun 2015 11:29:17 -0400 Subject: [PATCH 1/2] Add an 'author' entry to the context for the padCreate and padUpdate hooks. --- src/node/db/Pad.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index e70628b7a..8978d2530 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -105,9 +105,9 @@ Pad.prototype.appendRevision = function appendRevision(aChangeset, author) { authorManager.addPad(author, this.id); if (this.head == 0) { - hooks.callAll("padCreate", {'pad':this}); + hooks.callAll("padCreate", {'pad':this, 'author': author}); } else { - hooks.callAll("padUpdate", {'pad':this}); + hooks.callAll("padUpdate", {'pad':this, 'author': author}); } }; From bc78e0c68d2e662a02eb8bc1ee7ba13334c435ea Mon Sep 17 00:00:00 2001 From: Xavid Date: Sun, 21 Jun 2015 11:34:59 -0400 Subject: [PATCH 2/2] Update documentation for the updatePad and createPad hooks to include 'author' in the context. --- doc/api/hooks_server-side.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index a4505e936..79879b2fe 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -110,6 +110,7 @@ Called from: src/node/db/Pad.js Things in context: 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. @@ -128,6 +129,7 @@ Called from: src/node/db/Pad.js Things in context: 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.