Only fetch an extra message in get_old_messages if a narrow isn't specified

In the case where we're getting old messages for a narrowed view, the
anchor message id might not actually be in the result set so there's
no reason to fetch an extra message.

(imported from commit e610d1f2cb95be3ff9fce6dc95e40c560bc5bf84)
This commit is contained in:
Zev Benjamin
2013-04-23 13:26:29 -04:00
parent 6970f2deee
commit 6cdc3f67df
2 changed files with 11 additions and 6 deletions

View File

@@ -986,7 +986,7 @@ function load_more_messages(msg_list) {
msg_list: msg_list,
cont: function (messages) {
ui.hide_loading_more_messages_indicator();
if (messages.length === batch_size + 1) {
if (messages.length >= batch_size) {
load_more_enabled = true;
}
}