Fix website improperly submitting a last value of -1.

We were submitting a 'last' value of -1 to the server at startup,
which is invalid but normally ended up being OK because the user
usually had no messages whatsoever or had last be updated via
get_old_messages before the get_updates call went through.

(imported from commit df55ac1cdac443721c06ebed94a1c4b3ec7af2d1)
This commit is contained in:
Tim Abbott 2012-12-14 12:12:54 -05:00
parent aa0924f36b
commit 0dda71fb54
1 changed files with 1 additions and 2 deletions

View File

@ -8,7 +8,6 @@ var viewport = $(window);
var selected_message_id = -1; /* to be filled in on document.ready */
var selected_message = $(); /* = rows.get(selected_message_id) */
var get_updates_params = {
last: -1,
pointer: -1,
server_generation: -1 /* to be filled in on document.ready */
};
@ -416,7 +415,7 @@ function add_message_metadata(message, dummy) {
if (message_dict[message.id]) {
return message_dict[message.id];
}
get_updates_params.last = Math.max(get_updates_params.last, message.id);
get_updates_params.last = Math.max(get_updates_params.last || 0, message.id);
var involved_people;