mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
move timestamp to server
This commit is contained in:
@@ -15,8 +15,6 @@ define('forum/topic/diffs', ['forum/topic/images', 'benchpress', 'translator'],
|
|||||||
return app.alertError(err.message);
|
return app.alertError(err.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
timestamps.unshift(Date.now());
|
|
||||||
|
|
||||||
Benchpress.parse('partials/modals/post_history', {
|
Benchpress.parse('partials/modals/post_history', {
|
||||||
diffs: timestamps.map(function (timestamp) {
|
diffs: timestamps.map(function (timestamp) {
|
||||||
timestamp = parseInt(timestamp, 10);
|
timestamp = parseInt(timestamp, 10);
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var posts = require('../../posts');
|
var posts = require('../../posts');
|
||||||
|
|
||||||
module.exports = function (SocketPosts) {
|
module.exports = function (SocketPosts) {
|
||||||
SocketPosts.getDiffs = function (socket, data, callback) {
|
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) {
|
SocketPosts.showPostAt = function (socket, data, callback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user