Skip to content

Commit

Permalink
model: Restrict muted_topics access using a protected access modifier.
Browse files Browse the repository at this point in the history
Test amended.
  • Loading branch information
preetmishra committed Aug 1, 2020
1 parent 019e7ed commit 6734071
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/model/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ def test_is_muted_stream(self, muted_streams, stream_id, is_muted,
])
def test_is_muted_topic(self, topic, is_muted, stream_dict, model):
model.stream_dict = stream_dict
model.muted_topics = [
model._muted_topics = [
['Stream 2', 'muted topic'],
['Stream 1', 'muted stream muted topic'],
]
Expand Down
4 changes: 2 additions & 2 deletions zulipterminal/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, controller: Any) -> None:
(self.stream_dict, self.muted_streams,
self.pinned_streams, self.unpinned_streams) = stream_data

self.muted_topics = (
self._muted_topics = (
self.initial_data['muted_topics']) # type: List[List[str]]

groups = self.initial_data['realm_user_groups']
Expand Down Expand Up @@ -432,7 +432,7 @@ def is_muted_topic(self, stream_id: int, topic: str) -> bool:
"""
stream_name = self.stream_dict[stream_id]['name']
topic_to_search = [stream_name, topic] # type: List[str]
return topic_to_search in self.muted_topics
return topic_to_search in self._muted_topics

def _update_initial_data(self) -> None:
# Thread Processes to reduce start time.
Expand Down

0 comments on commit 6734071

Please sign in to comment.