mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
topic -> subject: Extract get_topic_from_message_info().
This changes files where it's safe to just assume caller may use either "topic" or "subject", and we prefer "topic" but support "subject".
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
from zerver.lib.request import JsonableError
|
||||
from zerver.lib.topic import (
|
||||
get_topic_from_message_info,
|
||||
)
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from typing import Any, Callable, Dict, Iterable, Mapping, Sequence
|
||||
@@ -38,7 +41,8 @@ def build_narrow_filter(narrow: Iterable[Sequence[str]]) -> Callable[[Mapping[st
|
||||
elif operator == "topic":
|
||||
if message["type"] != "stream":
|
||||
return False
|
||||
if operand.lower() != message["subject"].lower():
|
||||
topic_name = get_topic_from_message_info(message)
|
||||
if operand.lower() != topic_name.lower():
|
||||
return False
|
||||
elif operator == "sender":
|
||||
if operand.lower() != message["sender_email"].lower():
|
||||
|
||||
Reference in New Issue
Block a user