Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

search: Include history for is:resolved queries.

Kenneth Rodriguesba92cd8b2390
diff --git a/zerver/lib/narrow.py b/zerver/lib/narrow.py
index 8055612a1eb..4f10299c058 100644
--- a/zerver/lib/narrow.py
+++ b/zerver/lib/narrow.py
@@ -903,7 +903,7 @@ def ok_to_include_history(
# that's a property on the UserMessage table. There cannot be
# historical messages in these cases anyway.
for term in narrow:
- if term["operator"] == "is":
+ if term["operator"] == "is" and term["operand"] not in {"resolved"}:
include_history = False
return include_history
diff --git a/zerver/tests/test_message_fetch.py b/zerver/tests/test_message_fetch.py
index 13fa5f5815e..4f389b61c4e 100644
--- a/zerver/tests/test_message_fetch.py
+++ b/zerver/tests/test_message_fetch.py
@@ -1103,7 +1103,7 @@ class IncludeHistoryTest(ZulipTestCase):
dict(operator="channels", operand="public"),
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
narrow = [