summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2012-09-04 17:25:19 +0200
committerJohn McLear <john@mclear.co.uk>2012-09-04 17:25:19 +0200
commit21dcce22966640e4b72575a6458622a4079ee924 (patch)
tree938a22093e76f589c7965cfa409a12f94da58649
parent40a7b43799606bb582081e59d7a11ff9aa498ac2 (diff)
downloadetherpad-lite-21dcce22966640e4b72575a6458622a4079ee924.zip
Update src/node/db/AuthorManager.js
-rw-r--r--src/node/db/AuthorManager.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/node/db/AuthorManager.js b/src/node/db/AuthorManager.js
index 06b69051..6fe38abe 100644
--- a/src/node/db/AuthorManager.js
+++ b/src/node/db/AuthorManager.js
@@ -142,6 +142,25 @@ exports.getAuthor = function (author, callback)
}
/**
+ * Returns the Author Name of the author
+ * @param {String} author The id of the author
+ * @param {Function} callback callback(err, name)
+ */
+
+exports.getAuthorName = function (authorID, callback)
+{
+ db.getSub("globalAuthor:" + author, ["name"], callback);
+ console.log(authorID);
+ db.getSub("globalAuthor:" + authorID, ["name"], function(err, authorName){
+ if(ERR(err, callback)) return;
+ console.log(authorName);
+ callback(null, {authorName: authorName});
+ });
+}
+
+
+
+/**
* Returns the color Id of the author
* @param {String} author The id of the author
* @param {Function} callback callback(err, colorId)