Merge pull request #1428 from ether/padUsers-authorID

Include author ID in padUsers response
pull/1430/merge
John McLear 2013-01-29 09:41:39 -08:00
commit e7cb7c46c1
2 changed files with 2 additions and 1 deletions

View File

@ -355,7 +355,7 @@ returns the number of user that are currently editing this pad
returns the list of users that are currently editing this pad
*Example returns:*
* `{code: 0, message:"ok", data: {padUsers: [{colorId:"#c1a9d9","name":"username1","timestamp":1345228793126},{"colorId":"#d9a9cd","name":"Hmmm","timestamp":1345228796042}]}}`
* `{code: 0, message:"ok", data: {padUsers: [{colorId:"#c1a9d9","name":"username1","timestamp":1345228793126,"id":"a.n4gEeMLsvg12452n"},{"colorId":"#d9a9cd","name":"Hmmm","timestamp":1345228796042,"id":"a.n4gEeMLsvg12452n"}]}}`
* `{code: 0, message:"ok", data: {padUsers: []}}`
#### deletePad(padID)

View File

@ -1536,6 +1536,7 @@ exports.padUsers = function (padID, callback) {
}
var aid = sessioninfos[ix].author;
authorManager.getAuthor( aid, function ( err, author ) {
author.id = aid;
authors.push( author );
if ( authors.length === pad2sessions[padID].length ) {
callback(null, {padUsers: authors});