From 79d3c716e38084beab01d34a5f49a5aee7e72526 Mon Sep 17 00:00:00 2001 From: Snap Date: Sat, 25 Apr 2015 22:30:21 -0700 Subject: Some work on the Chat. Fixed bug where user could chat as "SERVER" --- pages/chat.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'pages') diff --git a/pages/chat.php b/pages/chat.php index a1870a6..4f10a1c 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -22,6 +22,7 @@ if (!$accepted) { var lastID = 1; //Internet Explorer doesn't support "const" //CONSTANTS: ... +var channelTimerDelay = 30000; var chatTimerDelayUpper = 9000; var chatTimerDelayLower = 2000; var chatTimerDelayDefault = 5000; @@ -45,6 +46,13 @@ function getChatTimer() { //addChatMessage("Debug", "Chat timer called!"); } +pollChannelListTimer(); +function pollChannelListTimer() { + setTimeout("pollChannelListTimer()", channelTimerDelay); + + pollChannelList(); +} + var firstGetChat = true; function getChatDone(data) { var newChats = false; @@ -288,7 +296,7 @@ function pollChannelListDone(data) { function channelListShow(JO) { console.log("Formating channelList"); - var p = ""; + var p = "
"; console.log('beginloop'); @@ -303,9 +311,11 @@ function channelListShow(JO) { styleClass = 'border-top: 6px solid #777799;'; } } - + + // u.secFromLastActive could be used in here someplace.. + if (u.wallEmblem == undefined) u.wallEmblem = 'blank.png'; - p = p+ ""; + p = p+ ""; p = p+ "
"; p = p+ "
"; @@ -408,7 +418,7 @@ $(function() { function onChatWindowShown() { chatTimerDelay = chatTimerDelayDefault; - getChatTimer(); + getChat(); } function onChatWindowHidden() -- cgit v1.2.3