summaryrefslogtreecommitdiff
path: root/bucky/app/bucky.js
diff options
context:
space:
mode:
Diffstat (limited to 'bucky/app/bucky.js')
-rw-r--r--bucky/app/bucky.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/bucky/app/bucky.js b/bucky/app/bucky.js
index cf74ec2..1b14f43 100644
--- a/bucky/app/bucky.js
+++ b/bucky/app/bucky.js
@@ -201,7 +201,25 @@ var bucky = module.exports = {
res.thread.set('settings', settings)
res.thread.save().then( () => next() )
},
-
+ ensureInterestedUsers: function(req, res, next){
+ // given a thread, find people who might be interested in it
+ // - other people who have been in threads with you
+ // - other people who have posted on the keyword
+ // for now though, just show the last 20 people who have logged in..
+ db.getLastlog(21).then( (users) => {
+ res.interestedUsers = users
+ next()
+ }).catch( () => {
+ res.interestedUsers = []
+ next()
+ })
+ },
+ ensureThreadUsers: function(req, res, next) {
+ db.getThreadUsers(res.thread.get('id')).then(thread_users => {
+ res.thread_users = thread_users
+ next()
+ })
+ },
destroyThread: function (req, res, next) {
console.log(">>> destroying thread", res.thread.get('id'))
var commentPromises = res.comments.map((comment) => {