mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	create-channel: Rename send_messages_for_new_subscribers helper.
Because send_messages_for_new_subscribers also sends channel
notification messages about newly created channels, a clearer
name for is send_user_subscribed_and_new_channel_notifications.
(cherry picked from commit 8b1e536e6b)
			
			
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							4264076e6d
						
					
				
				
					commit
					d5016b69ab
				
			@@ -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,
 | 
			
		||||
 
 | 
			
		||||
@@ -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]],
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user