message_header: Fix order of group direct message recipients.

Earlier, the order of recipients in recipient row of group direct
message weren't in the same sorting pattern as that of message
title which would result in inconsistent order of recipient names.

This commit fixes the behaviour in `private_message_header` in
recipient row to sort the names using `strcmp`.

Fixes part of zulip#27375.

Co-authored-by: richardshaju <richardshaju66@gmail.com>
This commit is contained in:
Pratik Chanda 2024-05-22 16:51:14 +05:30 committed by Tim Abbott
parent b9425d4d10
commit 9f94e6c58d
1 changed files with 1 additions and 1 deletions

View File

@ -212,7 +212,7 @@ function get_users_for_recipient_row(message) {
});
function compare_by_name(a, b) {
return a.full_name < b.full_name ? -1 : a.full_name > b.full_name ? 1 : 0;
return util.strcmp(a.full_name, b.full_name);
}
return users.sort(compare_by_name);