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:
evykassirer
2023-07-26 13:07:21 -07:00
committed by Tim Abbott
parent 45af8a9406
commit 846b470b99
31 changed files with 154 additions and 108 deletions

View File

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