fix: move meta.getServerTime call to admin namespace

v1.18.x
psychobunny 4 years ago
parent 45a4f1361f
commit 1c0e8c1663

@ -82,7 +82,7 @@ define('admin/settings/email', ['ace/ace', 'admin/settings'], function (ace) {
hour = 0; hour = 0;
} }
socket.emit('meta.getServerTime', {}, function (err, now) { socket.emit('admin.getServerTime', {}, function (err, now) {
if (err) { if (err) {
return app.alertError(err.message); return app.alertError(err.message);
} }

@ -109,4 +109,13 @@ SocketAdmin.reloadAllSessions = function (socket, data, callback) {
callback(); callback();
}; };
SocketAdmin.getServerTime = function (socket, data, callback) {
const now = new Date();
callback(null, {
timestamp: now.getTime(),
offset: now.getTimezoneOffset(),
});
};
require('../promisify')(SocketAdmin); require('../promisify')(SocketAdmin);

@ -60,14 +60,4 @@ function leaveCurrentRoom(socket) {
} }
} }
SocketMeta.getServerTime = function (socket, data, callback) {
// Returns server time in milliseconds
const now = new Date();
callback(null, {
timestamp: now.getTime(),
offset: now.getTimezoneOffset(),
});
};
module.exports = SocketMeta; module.exports = SocketMeta;

Loading…
Cancel
Save