Show timestamps on continued messages

This commit is contained in:
calzoneman 2013-05-09 21:12:01 -04:00
parent ab2118da48
commit bafce39107
1 changed files with 1 additions and 4 deletions

View File

@ -183,16 +183,13 @@ function addChatMessage(data) {
function formatChatMessage(data) { function formatChatMessage(data) {
var skip = data.username == LASTCHATNAME; var skip = data.username == LASTCHATNAME;
if(Date.now() > LASTCHATTIME + 60000) {
skip = false;
}
if(data.msgclass == "drink" || data.msgclass == "shout") { if(data.msgclass == "drink" || data.msgclass == "shout") {
skip = false; skip = false;
} }
LASTCHATNAME = data.username; LASTCHATNAME = data.username;
LASTCHATTIME = data.time; LASTCHATTIME = data.time;
var div = $("<div/>"); var div = $("<div/>");
if(USEROPTS.show_timestamps && !skip) { if(USEROPTS.show_timestamps) {
var time = $("<span/>").addClass("timestamp").appendTo(div); var time = $("<span/>").addClass("timestamp").appendTo(div);
var timestamp = new Date(data.time).toTimeString().split(" ")[0]; var timestamp = new Date(data.time).toTimeString().split(" ")[0];
time.text("["+timestamp+"] "); time.text("["+timestamp+"] ");