filter: Implement has: filters on client side.

Prior to this commit has:link, has:attachment, has:image
filter couldn't be applied locally and deferred filtering to
web server. This commits make sure client filters all messages
it can instead of completely deferring to the server and hence
improve speed.

A tradeoff is also made to turn off local echo for has: narrows
as messages with link sent to has:link narrow were locally echoing
to another narrow and not appearing in the active has:link narrow.

Fixes: #6186.
This commit is contained in:
Mohit Gupta
2020-06-13 22:35:31 +05:30
committed by Tim Abbott
parent a4f5b0c635
commit 02ea52fc18
4 changed files with 92 additions and 7 deletions

View File

@@ -146,7 +146,7 @@ exports.try_deliver_locally = function (message_request) {
return;
}
if (narrow_state.active() && !narrow_state.filter().can_apply_locally()) {
if (narrow_state.active() && !narrow_state.filter().can_apply_locally(true)) {
return;
}