diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js index 50f62ebd49..fe7265b800 100644 --- a/static/js/message_fetch.js +++ b/static/js/message_fetch.js @@ -110,6 +110,7 @@ function get_messages_success(data, opts) { // because doing so breaks the app in various modules that expect emails string. function handle_user_ids_supported_operators(data) { var user_ids_supported_operators = ['pm-with']; + var user_id_supported_operators = ['sender', 'group-pm-with']; if (data.narrow === undefined) { return data; @@ -121,6 +122,13 @@ function handle_user_ids_supported_operators(data) { filter.operand = people.emails_strings_to_user_ids_array(filter.operand); } + if (user_id_supported_operators.indexOf(filter.operator) !== -1) { + var person = people.get_by_email(filter.operand); + if (person !== undefined) { + filter.operand = person.user_id; + } + } + return filter; });