Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/api/http_api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ _Example returns:_

returns an array of authors who contributed to this pad

The synthetic `a.etherpad-system` author (used internally when content is inserted without an explicit `authorId` — HTTP API `setText`/`appendText`/`setHTML` calls without `authorId`, server-side imports, plugins like `ep_post_data`) is omitted from the returned list.

_Example returns:_

* `{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}`
Expand Down
2 changes: 2 additions & 0 deletions doc/api/http_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ return true of false

returns an array of authors who contributed to this pad

The synthetic `a.etherpad-system` author (used internally when content is inserted without an explicit `authorId` — HTTP API `setText`/`appendText`/`setHTML` calls without `authorId`, server-side imports, plugins like `ep_post_data`) is omitted from the returned list.

*Example returns:*
* `{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}`
* `{code: 1, message:"padID does not exist", data: null}`
Expand Down
8 changes: 7 additions & 1 deletion src/node/db/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,13 @@ Example returns:
exports.listAuthorsOfPad = async (padID: string) => {
// get the pad
const pad = await getPadSafe(padID, true);
const authorIDs = pad.getAllAuthors();
// Pad.SYSTEM_AUTHOR_ID is the synthetic author Etherpad attributes inserts to
// when no authorId is supplied (HTTP API setText/appendText/setHTML without
// authorId, server-side import flows, plugins like ep_post_data). It is an
// implementation detail of changeset bookkeeping, not a real contributor, so
// it should not surface through this public API.
const {Pad} = require('./Pad');
const authorIDs = pad.getAllAuthors().filter((id: string) => id !== Pad.SYSTEM_AUTHOR_ID);
return {authorIDs};
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
};

Expand Down
Loading