ImportHandler: Pass the pad ID to the `import` hook
This enables plugins to log the pad ID if desired.pull/5260/head
parent
caf4e9f28c
commit
fe87e2df87
|
@ -819,6 +819,7 @@ Context properties:
|
|||
|
||||
* `destFile`: The destination HTML filename.
|
||||
* `fileEnding`: The lower-cased filename extension from `srcFile`.
|
||||
* `padId`: The identifier of the destination pad.
|
||||
* `srcFile`: The document to convert.
|
||||
|
||||
## `userJoin`
|
||||
|
|
|
@ -143,7 +143,7 @@ const doImport = async (req, res, padId) => {
|
|||
|
||||
const destFile = path.join(tmpDirectory, `etherpad_import_${randNum}.${exportExtension}`);
|
||||
const importHandledByPlugin =
|
||||
(await hooks.aCallAll('import', {srcFile, destFile, fileEnding})).some((x) => x);
|
||||
(await hooks.aCallAll('import', {srcFile, destFile, fileEnding, padId})).some((x) => x);
|
||||
const fileIsEtherpad = (fileEnding === '.etherpad');
|
||||
const fileIsHTML = (fileEnding === '.html' || fileEnding === '.htm');
|
||||
const fileIsTXT = (fileEnding === '.txt');
|
||||
|
|
Loading…
Reference in New Issue