Make get_updates reload_pending request parameter an integer

This fixes a bug where the server wasn't returning from get_updates
immediately when the client needed a reload.

(imported from commit 1d854eb1c7061f468d091e103f10074f4c7231d8)
This commit is contained in:
Zev Benjamin 2012-10-18 15:25:53 -04:00
parent bbb67f61cc
commit ab382040c1
2 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,7 @@ var get_updates_params = {
last: -1,
failures: 0,
server_generation: -1, /* to be filled in on document.ready */
reload_pending: false
reload_pending: 0
};
$(function () {
@ -604,7 +604,7 @@ function get_updates() {
if (get_updates_params.server_generation === -1) {
get_updates_params.server_generation = data.server_generation;
} else if (data.server_generation !== get_updates_params.server_generation) {
get_updates_params.reload_pending = true;
get_updates_params.reload_pending = 1;
reload_app();
}

View File

@ -250,6 +250,8 @@ def return_messages_immediately(request, handler, user_profile, **kwargs):
last = int(last)
if failures is not None:
failures = int(failures)
if client_reload_pending is not None:
client_reload_pending = int(client_reload_pending)
where = 'bottom'
query = Message.objects.select_related().filter(usermessage__user_profile = user_profile).order_by('id')