From ea2e7ccf27dec685fec0640d3f70680d3526963d Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Sat, 13 Jul 2019 00:16:35 +0000 Subject: [PATCH] message_fetch: Use user ID for sender and group-pm-with operator. --- static/js/message_fetch.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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; });