narrow: Fix by_topic and by_recipient for stream and message ID.

In commit 846b470b99, `narrow.by_topic` was missed for getting
the stream name via the stream ID in the message data. Updates
function to get the stream name to pass in the filter terms
to `narrow.activate`.

In that same commit, `narrow.by_recipient` was updated to not
pass the message ID to `then_select_id`. Updates call to
`narrow.activate` to include that opts parameter so that the
selected message doesn't change.
This commit is contained in:
Lauryn Menard 2023-08-22 11:51:36 +02:00 committed by Tim Abbott
parent 321776ac49
commit b90505699a
1 changed files with 3 additions and 2 deletions

View File

@ -903,8 +903,9 @@ export function by_topic(target_id, opts) {
unread_ops.notify_server_message_read(original);
}
const stream_name = stream_data.get_stream_name_from_id(original.stream_id);
const search_terms = [
{operator: "stream", operand: original.stream},
{operator: "stream", operand: stream_name},
{operator: "topic", operand: original.topic},
];
opts = {then_select_id: target_id, ...opts};
@ -942,7 +943,7 @@ export function by_recipient(target_id, opts) {
// in the new view.
unread_ops.notify_server_message_read(message);
}
by("stream", stream_data.get_stream_name_from_id(message.stream_id));
by("stream", stream_data.get_stream_name_from_id(message.stream_id), opts);
break;
}
}