mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Add 2 new APIs: listPadsOfAuthor and listAuthorsOfPad
Return all pads that a given author has contributed to (not just created) and return all authors who has contributed to a given pad.
This commit is contained in:
parent
0bc01feb72
commit
6f9d7a5db7
4 changed files with 132 additions and 2 deletions
|
@ -47,6 +47,7 @@ exports.createGroupPad = groupManager.createGroupPad;
|
|||
|
||||
exports.createAuthor = authorManager.createAuthor;
|
||||
exports.createAuthorIfNotExistsFor = authorManager.createAuthorIfNotExistsFor;
|
||||
exports.listPadsOfAuthor = authorManager.listPadsOfAuthor;
|
||||
|
||||
/**********************/
|
||||
/**SESSION FUNCTIONS***/
|
||||
|
@ -463,6 +464,26 @@ exports.isPasswordProtected = function(padID, callback)
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
listAuthorsOfPad(padID) returns an array of authors who contributed to this pad
|
||||
|
||||
Example returns:
|
||||
|
||||
{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}
|
||||
{code: 1, message:"padID does not exist", data: null}
|
||||
*/
|
||||
exports.listAuthorsOfPad = function(padID, callback)
|
||||
{
|
||||
//get the pad
|
||||
getPadSafe(padID, true, function(err, pad)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
callback(null, {authorIDs: pad.getAllAuthors()});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/******************************/
|
||||
/** INTERNAL HELPER FUNCTIONS */
|
||||
/******************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue