mirror of https://github.com/zulip/zulip.git
search: Include history for is:resolved queries.
The previous logic assumed that all `is:` operators were those like `is:muted` or `is:starred`, which depend on personal data.
This commit is contained in:
parent
ffb182fb25
commit
ba92cd8b23
|
@ -903,7 +903,7 @@ def ok_to_include_history(
|
||||||
# that's a property on the UserMessage table. There cannot be
|
# that's a property on the UserMessage table. There cannot be
|
||||||
# historical messages in these cases anyway.
|
# historical messages in these cases anyway.
|
||||||
for term in narrow:
|
for term in narrow:
|
||||||
if term["operator"] == "is":
|
if term["operator"] == "is" and term["operand"] not in {"resolved"}:
|
||||||
include_history = False
|
include_history = False
|
||||||
|
|
||||||
return include_history
|
return include_history
|
||||||
|
|
|
@ -1103,7 +1103,7 @@ class IncludeHistoryTest(ZulipTestCase):
|
||||||
dict(operator="channels", operand="public"),
|
dict(operator="channels", operand="public"),
|
||||||
dict(operator="is", operand="resolved"),
|
dict(operator="is", operand="resolved"),
|
||||||
]
|
]
|
||||||
self.assertFalse(ok_to_include_history(narrow, user_profile, False))
|
self.assertTrue(ok_to_include_history(narrow, user_profile, False))
|
||||||
|
|
||||||
# simple True case
|
# simple True case
|
||||||
narrow = [
|
narrow = [
|
||||||
|
|
Loading…
Reference in New Issue