mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-05 17:15:04 -05:00
Fix: Display messages with server time instead of client time
This commit is contained in:
parent
abb123e6b8
commit
4af8998da9
@ -47,6 +47,7 @@ module.exports = {
|
||||
app.storage = new Storage();
|
||||
app.storage.open(cb);
|
||||
app.composing = {};
|
||||
app.timeInterval = 0;
|
||||
app.mucInfos = [];
|
||||
},
|
||||
function (cb) {
|
||||
@ -84,6 +85,21 @@ module.exports = {
|
||||
app.soundManager.loadFile('/sounds/threetone-alert.wav', 'threetone-alert');
|
||||
cb();
|
||||
},
|
||||
function (cb) {
|
||||
app.whenConnected(function () {
|
||||
function getInterval() {
|
||||
if (client.sessionStarted) {
|
||||
client.getTime(self.id, function (err, res) {
|
||||
if (err) return;
|
||||
self.timeInterval = res.time.utc - Date.now();
|
||||
});
|
||||
setTimeout(getInterval, 600000);
|
||||
}
|
||||
}
|
||||
getInterval();
|
||||
});
|
||||
cb();
|
||||
},
|
||||
function (cb) {
|
||||
function start() {
|
||||
// start our router and show the appropriate page
|
||||
|
@ -11,7 +11,7 @@ var ID_CACHE = {};
|
||||
|
||||
var Message = module.exports = HumanModel.define({
|
||||
initialize: function (attrs) {
|
||||
this._created = new Date(Date.now());
|
||||
this._created = new Date(Date.now() + app.timeInterval);
|
||||
},
|
||||
type: 'message',
|
||||
props: {
|
||||
|
Loading…
Reference in New Issue
Block a user