Files
NodeBB/src/socket.io/posts/diffs.js
Barış Soner Uşaklı 779d03cf57 move timestamp to server
2018-06-06 16:21:48 -04:00

23 lines
526 B
JavaScript

'use strict';
var async = require('async');
var posts = require('../../posts');
module.exports = function (SocketPosts) {
SocketPosts.getDiffs = function (socket, data, 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) {
posts.diffs.load(data.pid, data.since, socket.uid, callback);
};
};