mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 10:46:14 +01:00
fix: move meta.getServerTime call to admin namespace
This commit is contained in:
@@ -82,7 +82,7 @@ define('admin/settings/email', ['ace/ace', 'admin/settings'], function (ace) {
|
||||
hour = 0;
|
||||
}
|
||||
|
||||
socket.emit('meta.getServerTime', {}, function (err, now) {
|
||||
socket.emit('admin.getServerTime', {}, function (err, now) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
@@ -109,4 +109,13 @@ SocketAdmin.reloadAllSessions = function (socket, data, callback) {
|
||||
callback();
|
||||
};
|
||||
|
||||
SocketAdmin.getServerTime = function (socket, data, callback) {
|
||||
const now = new Date();
|
||||
|
||||
callback(null, {
|
||||
timestamp: now.getTime(),
|
||||
offset: now.getTimezoneOffset(),
|
||||
});
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user