mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
messages: Use stream_id instead of stream name.
This should cause no functional changes. This is part of a multi-step effort to move away from using stream names to reference streams, now that it's impossible for a user to write a message with an invalid stream name (since switching to the dropdown).
This commit is contained in:
@@ -258,6 +258,10 @@ export function get_stream_id(name: string): number | undefined {
|
||||
return stream_id;
|
||||
}
|
||||
|
||||
export function get_stream_name_from_id(stream_id: number): string {
|
||||
return get_sub_by_id(stream_id)?.name ?? "";
|
||||
}
|
||||
|
||||
export function get_sub_by_name(name: string): StreamSubscription | undefined {
|
||||
// Note: Only use this function for situations where
|
||||
// you are comfortable with a user dealing with an
|
||||
|
||||
Reference in New Issue
Block a user