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.

create-channel: Rename send_messages_for_new_subscribers helper.

Lauryn Menard8b1e536e6b11
diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py
index 1755a9856ac..3b473b3603f 100644
--- a/zerver/tests/test_subs.py
+++ b/zerver/tests/test_subs.py
@@ -4416,7 +4416,7 @@ class SubscriptionAPITest(ZulipTestCase):
with (
self.assert_database_query_count(23),
self.assert_memcached_count(11),
- mock.patch("zerver.views.streams.send_messages_for_new_subscribers"),
+ mock.patch("zerver.views.streams.send_user_subscribed_and_new_channel_notifications"),
):
self.subscribe_via_post(
desdemona,
diff --git a/zerver/views/streams.py b/zerver/views/streams.py
index 0d0cf362ab0..e0c729e3dfb 100644
--- a/zerver/views/streams.py
+++ b/zerver/views/streams.py
@@ -829,7 +829,7 @@ def create_channel(
send_new_subscription_messages
and len(new_subscribers) <= settings.MAX_BULK_NEW_SUBSCRIPTION_MESSAGES
):
- send_messages_for_new_subscribers(
+ send_user_subscribed_and_new_channel_notifications(
user_profile=user_profile,
subscribers=new_subscribers,
new_subscriptions={str(user.id): [name] for user in new_subscribers},
@@ -1017,7 +1017,7 @@ def add_subscriptions_backend(
if send_new_subscription_messages:
if len(result["subscribed"]) <= settings.MAX_BULK_NEW_SUBSCRIPTION_MESSAGES:
- send_messages_for_new_subscribers(
+ send_user_subscribed_and_new_channel_notifications(
user_profile=user_profile,
subscribers=subscribers,
new_subscriptions=result["subscribed"],
@@ -1036,7 +1036,7 @@ def add_subscriptions_backend(
return json_success(request, data=result)
-def send_messages_for_new_subscribers(
+def send_user_subscribed_and_new_channel_notifications(
user_profile: UserProfile,
subscribers: set[UserProfile],
new_subscriptions: dict[str, list[str]],