summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/site.clj18
-rw-r--r--static/js/pichat.js6
-rw-r--r--template/browser.st1
-rw-r--r--template/imagelayering.st1
-rw-r--r--template/rooms/VIP.st1
-rw-r--r--template/rooms/chat.st1
6 files changed, 6 insertions, 22 deletions
diff --git a/src/site.clj b/src/site.clj
index d66188e..7806d7b 100644
--- a/src/site.clj
+++ b/src/site.clj
@@ -640,7 +640,6 @@ WHERE u.user_id = ANY(?)"
(defn directory [session offset]
(let [st (fetch-template "directory" session)
users (get-directory-info (:user_id session) offset)]
- (prn users)
(.setAttribute st "users" users)
(cond (= offset 0) (.setAttribute st "prev" false)
(= offset 1) (.setAttribute st "prev" "")
@@ -670,18 +669,6 @@ WHERE u.user_id = ANY(?)"
;; Chat
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Chat format version history
-;
-; v0: Keys: users, messages, timestamp
-; Date: Mists of dump antiquity
-;
-; v1: Keys: users, messages, timestamp, v
-; Date: 2010/04/25
-; Note: Incorporates explicit version
-
-(def *chat-version-number* 1)
-
(defn validate-room-access [room-key session]
(if-let [room (lookup-room room-key)]
(or (not (room :admin_only))
@@ -714,7 +701,6 @@ WHERE u.user_id = ANY(?)"
(.setAttribute "isadminroom" (room :admin_only))
(.setAttribute "json_room_key" (json-str (room :key)))
(.setAttribute "json_user_nick" (if nick (json-str nick) "null"))
- (.setAttribute "version" *chat-version-number*)
(.setAttribute "roomname" (room :name))
(.setAttribute "dis" (= (room :name) "dis"))
(.setAttribute "timestamp" now))
@@ -742,8 +728,7 @@ WHERE u.user_id = ANY(?)"
:avatar (session :avatar)}))
(commute users assoc nick (user-struct-from-session session))))
(resp-success (assoc (updates nick room old-ts)
- :timestamp now
- :v *chat-version-number*)))))
+ :timestamp now)))))
(defn validated-refresh [session params]
(let [room-key (params :room)
@@ -814,7 +799,6 @@ WHERE u.user_id = ANY(?)"
(.setAttribute st "json_user_nick" (if nick (json-str nick) "null"))
(.setAttribute st "roomname" (room :name))
(.setAttribute st "timestamp" now)
- (.setAttribute st "version" *chat-version-number*)
(.toString st)))
diff --git a/static/js/pichat.js b/static/js/pichat.js
index ef45935..18e438a 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -465,7 +465,7 @@ function refresh() {
if (IsAdmin && window.console) {
console.error(resp, textStatus, errorThrown);
}
- setTimeout(refresh, 1000);
+ setTimeout(refresh, 4000);
};
$.ajax({
@@ -504,6 +504,10 @@ function initChat() {
// see /static/webcam/webcam.js
if ('webcam' in window) webcam.init()
+ startChatUpdater();
+}
+
+function startChatUpdater() {
setTimeout(refresh, 1000);
}
diff --git a/template/browser.st b/template/browser.st
index 42f1990..14797cf 100644
--- a/template/browser.st
+++ b/template/browser.st
@@ -12,7 +12,6 @@
var Nick = $json_user_nick$;
var Room = $json_room_key$;
var Timestamp = $timestamp$;
- var Version = $version$;
$if(isadmin)$
var IsAdmin = true;
$else$
diff --git a/template/imagelayering.st b/template/imagelayering.st
index 1d91571..66575b9 100644
--- a/template/imagelayering.st
+++ b/template/imagelayering.st
@@ -30,7 +30,6 @@ $endif$
var Nick = $json_user_nick$;
var Room = $json_room_key$;
var Timestamp = $timestamp$;
- var Version = $version$;
$if(isadmin)$
var IsAdmin = true;
$else$
diff --git a/template/rooms/VIP.st b/template/rooms/VIP.st
index dce74a6..119296b 100644
--- a/template/rooms/VIP.st
+++ b/template/rooms/VIP.st
@@ -30,7 +30,6 @@ $endif$
var Nick = $json_user_nick$;
var Room = $json_room_key$;
var Timestamp = $timestamp$;
- var Version = $version$;
$if(isadmin)$
var IsAdmin = true;
$else$
diff --git a/template/rooms/chat.st b/template/rooms/chat.st
index 06ff031..e3c5c65 100644
--- a/template/rooms/chat.st
+++ b/template/rooms/chat.st
@@ -30,7 +30,6 @@ $endif$
var Nick = $json_user_nick$;
var Room = $json_room_key$;
var Timestamp = $timestamp$;
- var Version = $version$;
$if(isadmin)$
var IsAdmin = true;
$else$