message_view: Live update on losing access to a stream.

This commit adds code to live update the message view when
user loses access to a stream and also remove the data of
messages from that stream.
This commit is contained in:
Sahil Batra
2025-04-25 12:17:09 +05:30
committed by Tim Abbott
parent 3383a69088
commit 52b20354e6
6 changed files with 114 additions and 33 deletions

View File

@@ -348,3 +348,9 @@ export function remove(message_ids: number[]): void {
stored_messages.delete(message_id);
}
}
export function get_message_ids_in_stream(stream_id: number): number[] {
return [...stored_messages.values()]
.filter((message) => message.type === "stream" && message.stream_id === stream_id)
.map((message) => message.id);
}