Don't update the pointer on the server when the client receives messages

(imported from commit 54a0d10e94d2f4d39a29d4c8596bf4712c1eb45b)
This commit is contained in:
Zev Benjamin 2012-10-23 16:35:06 -04:00
parent 8a39292b5d
commit d4c2fd6cb6
1 changed files with 4 additions and 2 deletions

View File

@ -512,7 +512,8 @@ function add_messages(data) {
// If we received the initially selected message, select it on the client side, // If we received the initially selected message, select it on the client side,
// but not if the user has already selected another one during load. // but not if the user has already selected another one during load.
if ((selected_message_id === -1) && (message_dict.hasOwnProperty(initial_pointer))) { if ((selected_message_id === -1) && (message_dict.hasOwnProperty(initial_pointer))) {
select_message_by_id(initial_pointer, {then_scroll: true}); select_message_by_id(initial_pointer,
{then_scroll: true, update_server: false});
} }
// If we prepended messages, then we need to scroll back to the pointer. // If we prepended messages, then we need to scroll back to the pointer.
@ -523,7 +524,8 @@ function add_messages(data) {
// We also need to re-select the message by ID, because we might have // We also need to re-select the message by ID, because we might have
// removed and re-added the row as part of prepend collapsing. // removed and re-added the row as part of prepend collapsing.
if ((data.where === 'top') && (selected_message_id >= 0)) { if ((data.where === 'top') && (selected_message_id >= 0)) {
select_message_by_id(selected_message_id, {then_scroll: true}); select_message_by_id(selected_message_id,
{then_scroll: true, update_server: false});
} }
if (autocomplete_needs_update) if (autocomplete_needs_update)