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.

minor: Rename stream_map -> user_stream_map.

Steve Howell3662bf2dcbcb
diff --git a/zerver/lib/digest.py b/zerver/lib/digest.py
index b479f5d6a52..ae844be8781 100644
--- a/zerver/lib/digest.py
+++ b/zerver/lib/digest.py
@@ -218,7 +218,7 @@ def gather_new_streams(user_profile: UserProfile,
def enough_traffic(hot_conversations: str, new_streams: int) -> bool:
return bool(hot_conversations or new_streams)
-def get_stream_map(user_ids: List[int]) -> Dict[int, Set[int]]:
+def get_user_stream_map(user_ids: List[int]) -> Dict[int, Set[int]]:
rows = Subscription.objects.filter(
user_profile_id__in=user_ids,
recipient__type=Recipient.STREAM,
@@ -241,14 +241,14 @@ def bulk_get_digest_context(users: List[UserProfile], cutoff: float) -> Dict[int
user_ids = [user.id for user in users]
- stream_map = get_stream_map(user_ids)
+ user_stream_map = get_user_stream_map(user_ids)
recently_modified_streams = get_modified_streams(user_ids, cutoff_date)
all_stream_ids = set()
for user in users:
- stream_ids = stream_map[user.id]
+ stream_ids = user_stream_map[user.id]
stream_ids -= recently_modified_streams.get(user.id, set())
all_stream_ids |= stream_ids
@@ -258,7 +258,7 @@ def bulk_get_digest_context(users: List[UserProfile], cutoff: float) -> Dict[int
recent_topics = get_recent_topics(sorted(list(all_stream_ids)), cutoff_date)
for user in users:
- stream_ids = stream_map[user.id]
+ stream_ids = user_stream_map[user.id]
hot_topics = get_hot_topics(recent_topics, stream_ids)