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

@@ -4,6 +4,7 @@ import * as browser_history from "./browser_history";
import * as channel from "./channel";
import * as message_store from "./message_store";
import * as narrow from "./narrow";
import * as stream_data from "./stream_data";
if (window.electron_bridge !== undefined) {
window.electron_bridge.on_event("logout", () => {
@@ -30,9 +31,13 @@ if (window.electron_bridge !== undefined) {
const data = {
type: message.type,
content: reply,
to: message.type === "private" ? message.reply_to : message.stream,
topic: message.topic,
};
if (message.type === "private") {
data.to = message.reply_to;
} else {
data.to = stream_data.get_stream_name_from_id(message.stream_id);
}
function success() {
if (message.type === "stream") {