bots: Do not remove bot from inaccessible streams on owner change.

See
https://chat.zulip.org/#narrow/channel/101-design/topic/manage.20bot.20access.20feature.20removal
This commit is contained in:
Shubham Padia
2025-02-25 09:19:06 +00:00
committed by Tim Abbott
parent 2c8d74735a
commit e57c43b705
7 changed files with 14 additions and 83 deletions

View File

@@ -1735,23 +1735,6 @@ def do_get_streams(
return stream_dicts
def get_subscribed_private_streams_for_user(user_profile: UserProfile) -> QuerySet[Stream]:
exists_expression = Exists(
Subscription.objects.filter(
user_profile=user_profile,
active=True,
is_user_active=True,
recipient_id=OuterRef("recipient_id"),
),
)
subscribed_private_streams = (
Stream.objects.filter(realm=user_profile.realm, invite_only=True, deactivated=False)
.alias(subscribed=exists_expression)
.filter(subscribed=True)
)
return subscribed_private_streams
def notify_stream_is_recently_active_update(stream: Stream, value: bool) -> None:
event = dict(
type="stream",