Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix contributor api methods #821

Merged
merged 1 commit into from
Jun 27, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/node/db/AuthorManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ exports.setAuthorColorId = function (author, colorId, callback)
/**
* Returns the name of the author
* @param {String} author The id of the author
* @param {String} name The name of the author
* @param {Function} callback callback(err, name)
*/
exports.getAuthorName = function (author, callback)
Expand All @@ -176,6 +175,7 @@ exports.getAuthorName = function (author, callback)
/**
* Sets the name of the author
* @param {String} author The id of the author
* @param {String} name The name of the author
* @param {Function} callback (optional)
*/
exports.setAuthorName = function (author, name, callback)
Expand All @@ -186,7 +186,6 @@ exports.setAuthorName = function (author, name, callback)
/**
* Returns an array of all pads this author contributed to
* @param {String} author The id of the author
* @param {String} name The name of the author
* @param {Function} callback (optional)
*/
exports.listPadsOfAuthor = function (authorID, callback)
Expand Down Expand Up @@ -225,7 +224,6 @@ exports.listPadsOfAuthor = function (authorID, callback)
* Adds a new pad to the list of contributions
* @param {String} author The id of the author
* @param {String} padID The id of the pad the author contributes to
* @param {Function} callback (optional)
*/
exports.addPad = function (authorID, padID)
{
Expand All @@ -238,11 +236,11 @@ exports.addPad = function (authorID, padID)
//the entry doesn't exist so far, let's create it
if(author.padIDs == null)
{
author.padIDs = {padIDs : {}};
author.padIDs = {};
}

//add the entry for this pad
author.padIDs[padID] = 1;
author.padIDs[padID] = 1;// anything, because value is not used

//save the new element back
db.set("globalAuthor:" + authorID, author);
Expand All @@ -253,7 +251,6 @@ exports.addPad = function (authorID, padID)
* Removes a pad from the list of contributions
* @param {String} author The id of the author
* @param {String} padID The id of the pad the author contributes to
* @param {Function} callback (optional)
*/
exports.removePad = function (authorID, padID)
{
Expand Down
2 changes: 1 addition & 1 deletion src/node/db/Pad.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Pad.prototype.appendRevision = function appendRevision(aChangeset, author) {
this.saveToDatabase();

// set the author to pad
if(author != '')
if(author)
authorManager.addPad(author, this.id);
};

Expand Down