mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
stream_topic: Refactor user_ids_muting_topic.
This refactors and renames user_ids_muting_topic to accept a parameter 'visibility_policy' and fetch user IDs that have a specific visibility_policy(provided as the parameter) set for a topic.
This commit is contained in:
committed by
Tim Abbott
parent
8eec4bf171
commit
409ef040bb
@@ -15,11 +15,11 @@ class StreamTopicTarget:
|
||||
self.stream_id = stream_id
|
||||
self.topic_name = topic_name
|
||||
|
||||
def user_ids_muting_topic(self) -> Set[int]:
|
||||
def user_ids_with_visibility_policy(self, visibility_policy: int) -> Set[int]:
|
||||
query = UserTopic.objects.filter(
|
||||
stream_id=self.stream_id,
|
||||
topic_name__iexact=self.topic_name,
|
||||
visibility_policy=UserTopic.MUTED,
|
||||
visibility_policy=visibility_policy,
|
||||
).values(
|
||||
"user_profile_id",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user