Skip to content

Commit

Permalink
compose_typeahead: Don't insert current user with user group PM pills.
Browse files Browse the repository at this point in the history
  • Loading branch information
synicalsyntax committed Jul 19, 2018
1 parent 0c5d3db commit 1406497
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend_tests/node_tests/composebox_typeahead.js
Expand Up @@ -572,6 +572,9 @@ run_test('initialize', () => {
var users = {100: hamlet, 104: lear};
return users[user_id];
};
people.my_current_email = function () {
return 'hamlet@zulip.com';
};
compose_pm_pill.set_from_typeahead = function (item) {
appended_names.push(item.full_name);
};
Expand Down
5 changes: 4 additions & 1 deletion static/js/composebox_typeahead.js
Expand Up @@ -638,7 +638,10 @@ exports.initialize = function () {
if (user_groups.is_user_group(item)) {
item.members.keys().forEach(function (user_id) {
var user = people.get_person_from_user_id(user_id);
compose_pm_pill.set_from_typeahead(user);
if (!people.is_current_user(user.email)) {
// don't add pill for current user
compose_pm_pill.set_from_typeahead(user);
}
});
} else {
compose_pm_pill.set_from_typeahead(item);
Expand Down

0 comments on commit 1406497

Please sign in to comment.