plugins: include more data within padUpdate hook (#4425)

* Including more data at pad update event

* docs: new context fields in padUpdate

Co-authored-by: Pedro Beschorner Marin <pedrobmarin@gmail.com>
pull/4423/head
chandi 2020-10-21 19:04:03 +02:00 committed by GitHub
parent 1e7a9e1791
commit 94cb000e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -169,6 +169,8 @@ Things in context:
1. pad - the pad instance
2. author - the id of the author who updated the pad
3. newRev - the index of the new revision
4. changeset - the changeset of this revision (see [Changeset Library](#index_changeset_library))
This hook gets called when an existing pad was updated.

View File

@ -109,7 +109,7 @@ Pad.prototype.appendRevision = async function appendRevision(aChangeset, author)
if (this.head == 0) {
hooks.callAll("padCreate", {'pad':this, 'author': author});
} else {
hooks.callAll("padUpdate", {'pad':this, 'author': author});
hooks.callAll("padUpdate", {'pad':this, 'author': author, 'revs': newRev, 'changeset': aChangeset});
}
await Promise.all(p);