stream_settings: Add new "Stream details" section in General tab.

We want to make it easier to find stream details such as creator,
creation date and stream id. The commit replaces the "Email address"
section in General tab of stream overlay with a new section called
"Stream details", "Email address" is now a field in this section.

If the stream does not have a creator, we only show the stream creation
date in creation details.

Fixes: #25648.
This commit is contained in:
tnmkr
2024-03-23 12:36:21 +05:30
committed by Tim Abbott
parent c31016cac3
commit bc8e6a86b5
12 changed files with 142 additions and 15 deletions

View File

@@ -3,6 +3,7 @@ import * as color_data from "./color_data";
import {FoldDict} from "./fold_dict";
import {page_params} from "./page_params";
import * as peer_data from "./peer_data";
import type {User} from "./people";
import * as people from "./people";
import * as settings_config from "./settings_config";
import * as settings_data from "./settings_data";
@@ -186,6 +187,14 @@ export function get_sub_by_id(stream_id: number): StreamSubscription | undefined
return stream_info.get(stream_id);
}
export function maybe_get_creator_details(creator_id: number | null): User | undefined {
if (creator_id === null) {
return undefined;
}
return people.get_user_by_id_assert_valid(creator_id);
}
export function get_stream_id(name: string): number | undefined {
// Note: Only use this function for situations where
// you are comfortable with a user dealing with an