mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Merge pull request #827 from MarkTraceur/develop
Add in padUsersCount method and API call
This commit is contained in:
commit
afa107e809
3 changed files with 14 additions and 1 deletions
|
@ -48,6 +48,7 @@ exports.createGroupPad = groupManager.createGroupPad;
|
||||||
exports.createAuthor = authorManager.createAuthor;
|
exports.createAuthor = authorManager.createAuthor;
|
||||||
exports.createAuthorIfNotExistsFor = authorManager.createAuthorIfNotExistsFor;
|
exports.createAuthorIfNotExistsFor = authorManager.createAuthorIfNotExistsFor;
|
||||||
exports.listPadsOfAuthor = authorManager.listPadsOfAuthor;
|
exports.listPadsOfAuthor = authorManager.listPadsOfAuthor;
|
||||||
|
exports.padUsersCount = padMessageHandler.padUsersCount;
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
/**SESSION FUNCTIONS***/
|
/**SESSION FUNCTIONS***/
|
||||||
|
|
|
@ -65,7 +65,8 @@ var functions = {
|
||||||
"getPublicStatus" : ["padID"],
|
"getPublicStatus" : ["padID"],
|
||||||
"setPassword" : ["padID", "password"],
|
"setPassword" : ["padID", "password"],
|
||||||
"isPasswordProtected" : ["padID"],
|
"isPasswordProtected" : ["padID"],
|
||||||
"listAuthorsOfPad" : ["padID"]
|
"listAuthorsOfPad" : ["padID"],
|
||||||
|
"padUsersCount" : ["padID"]
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1348,3 +1348,14 @@ function composePadChangesets(padId, startNum, endNum, callback)
|
||||||
callback(null, changeset);
|
callback(null, changeset);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of users in a pad
|
||||||
|
*/
|
||||||
|
exports.padUsersCount = function (padID, callback) {
|
||||||
|
if (!pad2sessions[padID] || typeof pad2sessions[padID] != typeof []) {
|
||||||
|
callback(null, {padUsersCount: 0});
|
||||||
|
} else {
|
||||||
|
callback(null, {padUsersCount: pad2sessions[padID].length});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue