mirror of https://github.com/zulip/zulip.git
minor: Rename stream_map -> user_stream_map.
This commit is contained in:
parent
11c93aced5
commit
3662bf2dcb
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue