Disable timestamps for past log sent from server

The past log sent from the server when joining a room does not
contain information about when the messages were sent, so we
do not show a timestamp for those messages.
This commit is contained in:
Cathy J. Fitzpatrick 2013-01-29 00:41:22 -07:00
parent b6a9c9d3d0
commit 310d8a806b

View File

@ -261,9 +261,14 @@ function BattleRoom(id, elem) {
}
selfR.battle.play();
if (data.battlelog) {
// Disable timestamps for the past log because the server does
// not tell us what time the messages were sent at.
var timestamps = prefs.timestamps;
prefs.timestamps = 'off';
for (var i = 0; i < data.battlelog.length; i++) {
selfR.battle.add(data.battlelog[i]);
}
prefs.timestamps = timestamps;
selfR.battle.fastForwardTo(-1);
}
selfR.updateMe();
@ -1562,7 +1567,12 @@ function Lobby(id, elem) {
data.log = data.log.splice(data.log.length - 100);
}
}
selfR.add(data.log);
// Disable timestamps for the past log because the server doesn't
// tell us what time the messages were sent at.
var timestamps = prefs.timestamps;
prefs.timestamps = 'off';
selfR.add(data.log); // Add past log.
prefs.timestamps = timestamps;
}
selfR.update(data);
selfR.chatFrameElem.scrollTop(selfR.chatElem.height());