mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-03-12 21:48:39 +01:00
wip aggregation implementation
This commit is contained in:
parent
7608757891
commit
ecef538d74
@ -316,9 +316,6 @@ BoardsAPI.prototype.getAllowedContentProducers = function(adminID,board,options)
|
||||
if(options.posts) this.retrieveListOfApproved('posts',addr,adminID,board)
|
||||
// Get approved comments list
|
||||
if(options.comments) this.retrieveListOfApproved('comments',addr,adminID,board)
|
||||
if(settings.whitelist == true){
|
||||
// TODO: emit all whitelisted users
|
||||
}
|
||||
} else if(settings.whitelist_only == true){
|
||||
// TODO: emit all whitelisted users
|
||||
} else if(settings.blacklist == true){
|
||||
@ -335,13 +332,22 @@ BoardsAPI.prototype.getPostsInBoard = function(adminID,board){
|
||||
// Automatically download approved posts
|
||||
ret.forEach(item => this.downloadPost(item.hash,adminID,board))
|
||||
})
|
||||
this.ee.on('whitelist for '+board+'@'+adminID, whitelist => {
|
||||
// download posts for each user in whitelist
|
||||
whitelist.forEach(item => {
|
||||
this.getUserPostListInBoard(item,board,(err,postList) => {
|
||||
postList.forEach( i => this.downloadPost(i,adminID,board))
|
||||
})
|
||||
})
|
||||
})
|
||||
// Get allowed content and content producers
|
||||
this.getAllowedContentProducers(adminID,board,{ posts: true })
|
||||
// Get the admin's posts
|
||||
this.getUserPostListInBoard(adminID,board,(err,res) => {
|
||||
if(err){
|
||||
console.log(err)
|
||||
} else res.forEach(item => this.downloadPost(item.hash,adminID,board,adminID))
|
||||
})
|
||||
this.getAllowedContentProducers(adminID,board,{ posts: true })
|
||||
} else {
|
||||
// TODO: Download all posts in board from everyone
|
||||
// Download my posts
|
||||
|
Loading…
Reference in New Issue
Block a user