From 310d8a806b39d4d47055fdf0cbacaee0756e7f54 Mon Sep 17 00:00:00 2001 From: "Cathy J. Fitzpatrick" Date: Tue, 29 Jan 2013 00:41:22 -0700 Subject: [PATCH] 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. --- js/sim.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/sim.js b/js/sim.js index 9be74e57a..bcde9e291 100644 --- a/js/sim.js +++ b/js/sim.js @@ -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());