diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js index ee621770c9..e627927bd5 100644 --- a/static/js/message_fetch.js +++ b/static/js/message_fetch.js @@ -110,7 +110,7 @@ function get_messages_success(data, opts) { // because doing so breaks the app in various modules that expect emails string. function handle_operators_supporting_id_based_api(data) { var operators_supporting_ids = ['pm-with']; - var operators_supporting_id = ['sender', 'group-pm-with']; + var operators_supporting_id = ['sender', 'group-pm-with', 'stream']; if (data.narrow === undefined) { return data; @@ -123,6 +123,16 @@ function handle_operators_supporting_id_based_api(data) { } if (operators_supporting_id.indexOf(filter.operator) !== -1) { + if (filter.operator === 'stream') { + const stream_id = stream_data.get_stream_id(filter.operand); + if (stream_id !== undefined) { + filter.operand = stream_id; + } + + return filter; + } + + // The other operands supporting object IDs all work with user objects. var person = people.get_by_email(filter.operand); if (person !== undefined) { filter.operand = person.user_id;