mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Make add_messages do everything relating to message adding
Now that it's only called from get_updates_longpoll, we don't need to break out specific parts that are only needed there. (imported from commit 60d1cb25d0044ed1b2325d977b869617587e6a0f)
This commit is contained in:
parent
017c5e87bd
commit
1e02fc140b
@ -764,6 +764,12 @@ function add_messages(zephyrs) {
|
||||
// Even when narrowed, add messages to the home view so they exist when we un-narrow.
|
||||
add_to_table(zephyrs, 'zhome', function () { return true; });
|
||||
|
||||
$.each(zephyrs, function () {
|
||||
zephyr_array.push(this);
|
||||
if (this.id === initial_pointer)
|
||||
select_and_show_by_id(initial_pointer);
|
||||
});
|
||||
|
||||
if (autocomplete_needs_update)
|
||||
update_autocomplete();
|
||||
}
|
||||
@ -788,11 +794,6 @@ function get_updates_longpoll() {
|
||||
|
||||
if (data && data.zephyrs) {
|
||||
add_messages(data.zephyrs);
|
||||
$.each(data.zephyrs, function () {
|
||||
zephyr_array.push(this);
|
||||
if (this.id === initial_pointer)
|
||||
select_and_show_by_id(initial_pointer);
|
||||
});
|
||||
}
|
||||
setTimeout(get_updates_longpoll, 0);
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user