summaryrefslogtreecommitdiff
path: root/bucky/app/bucky.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-15 02:43:51 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-15 02:43:51 +0100
commit1466563673ffe6c41ec9a18bf98565b8562ee4f3 (patch)
tree1eb576380877d3231910ccbb634f33906210ab3f /bucky/app/bucky.js
parent0541e7d7457d646dceca375b7fa6e1f382232772 (diff)
thread_users hackery
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) => {