mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Allow "default" bots to see mentions on all streams.
This change allows normal bots to get UserMessage rows when they are mentioned on a stream, even if they are not actually subscribed to the stream. Fixes #7140.
This commit is contained in:
		@@ -409,6 +409,7 @@ class RecipientInfoTest(ZulipTestCase):
 | 
			
		||||
            stream_push_user_ids={hamlet.id},
 | 
			
		||||
            um_eligible_user_ids=all_user_ids,
 | 
			
		||||
            long_term_idle_user_ids=set(),
 | 
			
		||||
            default_bot_user_ids=set(),
 | 
			
		||||
            service_bot_tuples=[],
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
@@ -451,6 +452,25 @@ class RecipientInfoTest(ZulipTestCase):
 | 
			
		||||
            (service_bot.id, UserProfile.EMBEDDED_BOT),
 | 
			
		||||
        ])
 | 
			
		||||
 | 
			
		||||
        # Add a normal bot.
 | 
			
		||||
        normal_bot = do_create_user(
 | 
			
		||||
            email='normal-bot@zulip.com',
 | 
			
		||||
            password='',
 | 
			
		||||
            realm=realm,
 | 
			
		||||
            full_name='',
 | 
			
		||||
            short_name='',
 | 
			
		||||
            active=True,
 | 
			
		||||
            bot_type=UserProfile.DEFAULT_BOT,
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        info = get_recipient_info(
 | 
			
		||||
            recipient=recipient,
 | 
			
		||||
            sender_id=hamlet.id,
 | 
			
		||||
            stream_topic=stream_topic,
 | 
			
		||||
            possibly_mentioned_user_ids={service_bot.id, normal_bot.id}
 | 
			
		||||
        )
 | 
			
		||||
        self.assertEqual(info['default_bot_user_ids'], {normal_bot.id})
 | 
			
		||||
 | 
			
		||||
class BulkUsersTest(ZulipTestCase):
 | 
			
		||||
    def test_client_gravatar_option(self):
 | 
			
		||||
        # type: () -> None
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user