mirror of https://github.com/zulip/zulip.git
message_fetch: Use user ID for sender and group-pm-with operator.
This commit is contained in:
parent
b338fd130e
commit
ea2e7ccf27
|
@ -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;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue