Node.js based forum software built for the modern web
move timestamp to server
Barış Soner Uşaklı779d03cf574a
diff --git a/public/src/client/topic/diffs.js b/public/src/client/topic/diffs.jsindex 6d25d1d4e3..be7b5b0731 100644--- a/public/src/client/topic/diffs.js+++ b/public/src/client/topic/diffs.js@@ -15,8 +15,6 @@ define('forum/topic/diffs', ['forum/topic/images', 'benchpress', 'translator'],return app.alertError(err.message);}- timestamps.unshift(Date.now());-Benchpress.parse('partials/modals/post_history', {diffs: timestamps.map(function (timestamp) {timestamp = parseInt(timestamp, 10);diff --git a/src/socket.io/posts/diffs.js b/src/socket.io/posts/diffs.jsindex 7f208dc71f..c8f7c72259 100644--- a/src/socket.io/posts/diffs.js+++ b/src/socket.io/posts/diffs.js@@ -1,10 +1,19 @@'use strict';+var async = require('async');var posts = require('../../posts');module.exports = function (SocketPosts) {SocketPosts.getDiffs = function (socket, data, callback) {- posts.diffs.list(data.pid, callback);+ async.waterfall([+ function (next) {+ posts.diffs.list(data.pid, next);+ },+ function (timestamps, next) {+ timestamps.unshift(Date.now());+ next(null, timestamps);+ },+ ], callback);};SocketPosts.showPostAt = function (socket, data, callback) {