diff --git a/lib/boards-api.js b/lib/boards-api.js index bc1b5a3..e933c25 100644 --- a/lib/boards-api.js +++ b/lib/boards-api.js @@ -424,6 +424,7 @@ BoardsAPI.prototype.getCommentsFor = function(parent,board,adminID,target){ if(err2){ this.ee.emit('error',err2) } else if(typeof obj.previous == 'string'){ + // Also get comments for the previous version of the parent! this.getCommentsFor(obj.previous,board,adminID,parent) } }) @@ -435,6 +436,15 @@ BoardsAPI.prototype.getCommentsFor = function(parent,board,adminID,target){ res.forEach(item => this.downloadComment(item.hash,adminID,board,target)) } }) + // Download comments from whitelisted + this.ee.on('whitelist for '+board+'@'+adminID, whitelist => { + // download posts for each user in whitelist + whitelist.forEach(item => { + this.getUserCommentList(parent,item,(err,res) => { + res.forEach(i => this.downloadComment(i.hash,adminID,board,target)) + }) + }) + }) // Handle approved comments this.ee.on('approved comments for '+board+'@'+adminID,ret => { ret.forEach(item => this.downloadComment(item.hash,adminID,board,target))