summaryrefslogtreecommitdiff
path: root/static/js/pichat.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/pichat.js')
-rw-r--r--static/js/pichat.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js
index f72dbda..ab95c77 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -352,6 +352,10 @@ function updateTopic(newTopic) {
function refresh() {
var onSuccess = function(json) {
try {
+ if (json.v && (typeof Version == 'undefined' || Version != json.v)) {
+ location.reload();
+ }
+
Timestamp = json.timestamp;
$.map(json.messages, function(msg){ MessageContentCache[msg.msg_id.toString()] = msg.content })
@@ -374,6 +378,9 @@ function refresh() {
setTimeout(refresh, 1000);
};
var onError = function(resp, textStatus, errorThrown) {
+ var msg = $.trim(resp.responseText);
+ if (msg == "UNKNOWN_ROOM")
+ location.href = "http://dump.fm";
if (IsAdmin && window.console) {
console.error(resp, textStatus, errorThrown);
}
@@ -632,7 +639,8 @@ function setupUpload(elementId, roomKey) {
}
};
var onComplete = function(file, response) {
- r = $.trim(response);
+ var r = $.trim(response);
+ g = r;
if (r.match(/FILE_TOO_BIG/)) {
var maxSize = r.split(" ")[1] / 1024;
alert("Sorry. Your file is just too fucking big. "