From 3b0eca3be2a43cd396fd59208dde506cca08e3bb Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 16 Aug 2016 22:27:21 +0300 Subject: [PATCH] fix timestamp on posts.reply --- src/socket.io/posts.js | 1 + src/topics/create.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 3251c3700c..6c86458fc2 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -30,6 +30,7 @@ SocketPosts.reply = function(socket, data, callback) { data.uid = socket.uid; data.req = websockets.reqFromSocket(socket); + data.timestamp = Date.now(); topics.reply(data, function(err, postData) { if (err) { diff --git a/src/topics/create.js b/src/topics/create.js index cd1bf23a62..65f829c694 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -230,7 +230,15 @@ module.exports = function(Topics) { check(content, meta.config.minimumPostLength, meta.config.maximumPostLength, 'content-too-short', 'content-too-long', next); }, function(next) { - posts.create({uid: uid, tid: tid, handle: data.handle, content: content, toPid: data.toPid, timestamp: data.timestamp, ip: data.req ? data.req.ip : null}, next); + posts.create({ + uid: uid, + tid: tid, + handle: data.handle, + content: content, + toPid: data.toPid, + timestamp: data.timestamp, + ip: data.req ? data.req.ip : null + }, next); }, function(_postData, next) { postData = _postData;