From acdca15e6a54516ced1299bf25a55588ad457131 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Fri, 21 Jun 2013 12:23:49 -0400 Subject: [PATCH 1/3] possible fix for issue #12 --- src/posts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/posts.js b/src/posts.js index 30807e830f..99ec325a54 100644 --- a/src/posts.js +++ b/src/posts.js @@ -185,12 +185,12 @@ marked.setOptions({ Posts.get_cid_by_pid(pid, function(cid) { RDB.del('cid:' + cid + ':read_by_uid'); + RDB.zadd('categories:recent_posts:cid:' + cid, Date.now(), pid); + + topics.markAsRead(tid, uid); }); - // Re-add the poster, so he/she does not get an "unread" flag on this topic - topics.markAsRead(tid, uid); - // this will duplicate once we enter the thread, which is where we should be going socket.emit('event:alert', { title: 'Reply Successful', From e49d2707ebacc5e75505aebb4e4d94a3c773bc83 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Fri, 21 Jun 2013 12:53:50 -0400 Subject: [PATCH 2/3] changed the follower/following keys --- src/posts.js | 2 +- src/user.js | 39 ++++++++++++++++----------------------- src/websockets.js | 2 -- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/posts.js b/src/posts.js index 99ec325a54..f287928ae6 100644 --- a/src/posts.js +++ b/src/posts.js @@ -203,7 +203,7 @@ marked.setOptions({ threadTools.notify_followers(tid, uid); user.getUserFields(uid, ['username','reputation','picture','signature'], function(data) { - + var timestamp = Date.now(); io.sockets.in('topic_' + tid).emit('event:new_post', { diff --git a/src/user.js b/src/user.js index 887263cba9..cc08d41cf1 100644 --- a/src/user.js +++ b/src/user.js @@ -11,7 +11,7 @@ var utils = require('./../public/src/utils.js'), (function(User) { User.getUserField = function(uid, field, callback) { - RDB.hget('user:'+uid, field, function(err, data){ + RDB.hget('user:'+uid, field, function(err, data) { if(err === null) callback(data); else @@ -20,7 +20,7 @@ var utils = require('./../public/src/utils.js'), } User.getUserFields = function(uid, fields, callback) { - RDB.hmget('user:'+uid, fields, function(err, data){ + RDB.hmget('user:'+uid, fields, function(err, data) { if(err === null) { var returnData = {}; @@ -50,7 +50,7 @@ var utils = require('./../public/src/utils.js'), for (var i=0, ii=uuids.length; i 150) - { + if(data['signature'] !== undefined && data['signature'].length > 150) { callback({error:'Signature can\'t be longer than 150 characters!'}); return; } @@ -126,11 +124,6 @@ var utils = require('./../public/src/utils.js'), userkeys.splice(anonUserIndex, 1); } - // removes user:1:following and user:1:followers, - need to find a better way for this - userkeys = userkeys.filter(function(value, index, self){ - return value.indexOf(':f') === -1; - }); - for(var i=0,ii=userkeys.length; i Date: Fri, 21 Jun 2013 13:20:37 -0400 Subject: [PATCH 3/3] closes issue #18 --- public/templates/topic.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 63f88a2e88..d608a532bf 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -94,7 +94,7 @@