summaryrefslogtreecommitdiff
path: root/src/node/db
diff options
context:
space:
mode:
authorStephan Jauernick <info@stephan-jauernick.de>2014-05-31 00:43:31 +0200
committerStephan Jauernick <info@stephan-jauernick.de>2014-05-31 00:43:31 +0200
commitfffdde0c593106f9d5c383e6103fc68b48e3c75d (patch)
tree0455c5d5f58e746a3671284553e7da6789c17b5a /src/node/db
parent493636ec3661b2ad96bc16a7943d9b69aad9695c (diff)
downloadetherpad-lite-fffdde0c593106f9d5c383e6103fc68b48e3c75d.zip
Implemented the the new API method getPadID for reversing the Readonly ID. Based on: https://github.com/disy-mk/etherpad-lite/commit/ff88c19fc12887a49fdb752adb15ee3145f521f0
Diffstat (limited to 'src/node/db')
-rw-r--r--src/node/db/API.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/node/db/API.js b/src/node/db/API.js
index c1050464..f9e4695d 100644
--- a/src/node/db/API.js
+++ b/src/node/db/API.js
@@ -641,6 +641,32 @@ exports.getReadOnlyID = function(padID, callback)
}
/**
+getPadID(roID) returns the padID of a pad based on the readonlyID(roID)
+
+Example returns:
+
+{code: 0, message:"ok", data: null}
+{code: 1, message:"padID does not exist", data: null}
+*/
+exports.getPadID = function(roID, callback)
+{
+ //get the PadId
+ readOnlyManager.getPadId(roID, function(err, padID)
+ {
+ if(ERR(err, callback)) return;
+
+ if(padID == null)
+ {
+ callback(new customError("padID does not exist","apierror"));
+ }
+ else
+ {
+ callback(null, {PadID: padID});
+ }
+ });
+}
+
+/**
setPublicStatus(padID, publicStatus) sets a boolean for the public status of a pad
Example returns: