typeahead: Prevent duplicate private message recipients.

This matches the recipients and displays the ones which haven't been
added already.

Fixes: #2499.
This commit is contained in:
vaibhav
2017-01-01 23:08:03 +05:30
committed by Tim Abbott
parent fa3a1de9c7
commit 268770489b

View File

@@ -436,6 +436,10 @@ exports.initialize = function () {
if (! current_recipient.match(/\S/)) {
return false;
}
var recipients = util.extract_pm_recipients(this.query);
if (recipients.indexOf(item.email) > -1) {
return false;
}
return query_matches_person(current_recipient, item);
},