mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
minor: Rename stream_map -> user_stream_map.
This commit is contained in:
@@ -218,7 +218,7 @@ def gather_new_streams(user_profile: UserProfile,
|
|||||||
def enough_traffic(hot_conversations: str, new_streams: int) -> bool:
|
def enough_traffic(hot_conversations: str, new_streams: int) -> bool:
|
||||||
return bool(hot_conversations or new_streams)
|
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(
|
rows = Subscription.objects.filter(
|
||||||
user_profile_id__in=user_ids,
|
user_profile_id__in=user_ids,
|
||||||
recipient__type=Recipient.STREAM,
|
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]
|
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)
|
recently_modified_streams = get_modified_streams(user_ids, cutoff_date)
|
||||||
|
|
||||||
all_stream_ids = set()
|
all_stream_ids = set()
|
||||||
|
|
||||||
for user in users:
|
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())
|
stream_ids -= recently_modified_streams.get(user.id, set())
|
||||||
all_stream_ids |= stream_ids
|
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)
|
recent_topics = get_recent_topics(sorted(list(all_stream_ids)), cutoff_date)
|
||||||
|
|
||||||
for user in users:
|
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)
|
hot_topics = get_hot_topics(recent_topics, stream_ids)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user