Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

filter: Fix order of group direct message recipients on message title.

Pratik Chanda465b40e7ae0c
diff --git a/web/src/filter.ts b/web/src/filter.ts
index d14b2315ed1..7ab22ad7016 100644
--- a/web/src/filter.ts
+++ b/web/src/filter.ts
@@ -1305,6 +1305,7 @@ export class Filter {
}
return person.full_name;
});
+ names.sort(util.make_strcmp());
return util.format_array_as_list(names, "long", "conjunction");
}
if (term_types.length === 1 && _.isEqual(term_types, ["sender"])) {
diff --git a/web/tests/filter.test.js b/web/tests/filter.test.js
index c6578c9ccef..4add189d0e6 100644
--- a/web/tests/filter.test.js
+++ b/web/tests/filter.test.js
@@ -2163,7 +2163,7 @@ test("navbar_helpers", () => {
terms: dm_group_including_guest,
is_common_narrow: true,
zulip_icon: "user",
- title: "translated: alice (guest) and joe",
+ title: "joe and translated: alice (guest)",
redirect_url_with_search: "/#narrow/dm/" + joe.user_id + "," + alice.user_id + "-group",
},
{
@@ -2172,8 +2172,8 @@ test("navbar_helpers", () => {
zulip_icon: "user",
title: properly_separated_names([
joe.full_name,
- steve.full_name,
+ steve.full_name,
]),
redirect_url_with_search: "/#narrow/dm/undefined",
},