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:
Steve Howell
2017-10-24 11:08:19 -07:00
committed by Tim Abbott
parent 53dbcbe2a4
commit a70ede6c75
3 changed files with 55 additions and 13 deletions

View File

@@ -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