Skip to content

Commit ebbd5f1

Browse files
showelltimabbott
authored andcommitted
refactor: Pass realm to notify_subscriptions_removed.
1 parent 966d88a commit ebbd5f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

zerver/lib/actions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4171,11 +4171,13 @@ def get_available_notification_sounds() -> List[str]:
41714171
return sorted(available_notification_sounds)
41724172

41734173

4174-
def notify_subscriptions_removed(user_profile: UserProfile, streams: Iterable[Stream]) -> None:
4174+
def notify_subscriptions_removed(
4175+
realm: Realm, user_profile: UserProfile, streams: Iterable[Stream]
4176+
) -> None:
41754177

41764178
payload = [dict(name=stream.name, stream_id=stream.id) for stream in streams]
41774179
event = dict(type="subscription", op="remove", subscriptions=payload)
4178-
send_event(user_profile.realm, event, [user_profile.id])
4180+
send_event(realm, event, [user_profile.id])
41794181

41804182

41814183
SubAndRemovedT = Tuple[List[Tuple[UserProfile, Stream]], List[Tuple[UserProfile, Stream]]]
@@ -4264,7 +4266,7 @@ def get_non_subscribed_subs() -> List[Tuple[UserProfile, Stream]]:
42644266
for user_profile in users:
42654267
if len(streams_by_user[user_profile.id]) == 0:
42664268
continue
4267-
notify_subscriptions_removed(user_profile, streams_by_user[user_profile.id])
4269+
notify_subscriptions_removed(our_realm, user_profile, streams_by_user[user_profile.id])
42684270

42694271
event = {
42704272
"type": "mark_stream_messages_as_read",

0 commit comments

Comments
 (0)