streams: Add function to get topic for channel events notifications.

Refactored the code to add a function `channel_events_topic_name`
to get the topic name for sending notification for channel events.
This commit is contained in:
Vector73
2025-07-07 06:38:41 +00:00
committed by Tim Abbott
parent 20aace98cd
commit 7afed92c00
3 changed files with 16 additions and 10 deletions

View File

@@ -263,6 +263,10 @@ def get_user_ids_with_metadata_access_via_permission_groups(stream: Stream) -> s
return users_with_metadata_access_dict[stream.id]
def channel_events_topic_name(stream: Stream) -> str:
return str(Realm.STREAM_EVENTS_NOTIFICATION_TOPIC_NAME)
@transaction.atomic(savepoint=False)
def create_stream_if_needed(
realm: Realm,