mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
added deletePad API function
This commit is contained in:
parent
783c192726
commit
d2c502e2be
9 changed files with 134 additions and 7 deletions
|
@ -42,7 +42,7 @@ var functions = {
|
|||
"createPad" : ["padID", "text"],
|
||||
"createGroupPad" : ["groupID", "padName", "text"],
|
||||
"createAuthor" : ["name"],
|
||||
"createAuthorIfNotExistsFor" : ["authorMapper" , "name"],
|
||||
"createAuthorIfNotExistsFor": ["authorMapper" , "name"],
|
||||
"createSession" : ["groupID", "authorID", "validUntil"],
|
||||
"deleteSession" : ["sessionID"],
|
||||
"getSessionInfo" : ["sessionID"],
|
||||
|
@ -51,7 +51,7 @@ var functions = {
|
|||
"getText" : ["padID", "rev"],
|
||||
"setText" : ["padID", "text"],
|
||||
"getRevisionsCount" : ["padID"],
|
||||
// "deletePad" : ["padID"],
|
||||
"deletePad" : ["padID"],
|
||||
"getReadOnlyID" : ["padID"],
|
||||
"setPublicStatus" : ["padID", "publicStatus"],
|
||||
"getPublicStatus" : ["padID"],
|
||||
|
|
|
@ -73,6 +73,23 @@ exports.handleConnect = function(client)
|
|||
sessioninfos[client.id]={};
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicks all sessions from a pad
|
||||
* @param client the new client
|
||||
*/
|
||||
exports.kickSessionsFromPad = function(padID)
|
||||
{
|
||||
//skip if there is nobody on this pad
|
||||
if(!pad2sessions[padID])
|
||||
return;
|
||||
|
||||
//disconnect everyone from this pad
|
||||
for(var i in pad2sessions[padID])
|
||||
{
|
||||
socketio.sockets.sockets[pad2sessions[padID][i]].json.send({disconnect:"deleted"});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the disconnection of a user
|
||||
* @param client the client that leaves
|
||||
|
@ -687,7 +704,7 @@ function handleClientReady(client, message)
|
|||
{
|
||||
if(sessioninfos[pad2sessions[message.padId][i]].author == author)
|
||||
{
|
||||
socketio.sockets.sockets[pad2sessions[message.padId][i]].json.send({disconnect:"doublelogin"});
|
||||
socketio.sockets.sockets[pad2sessions[message.padId][i]].json.send({disconnect:"userdup"});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue