Skip to content

Commit

Permalink
feat: dont autocomplete ignored users
Browse files Browse the repository at this point in the history
  • Loading branch information
vyneer committed Sep 8, 2024
1 parent 50d6e77 commit c64d33d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions assets/chat/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1041,9 +1041,10 @@ class Chat {
if (data.recipient) {
users.push(this.addUser(data.recipient));
}
users.forEach((u) =>
this.autocomplete.add(u.displayName, false, Date.now()),
);
users.forEach((u) => {
if (this.ignored(u.username)) return;
this.autocomplete.add(u.displayName, false, Date.now());
});
}
}

Expand Down Expand Up @@ -1647,6 +1648,8 @@ class Chat {
if (!failure) {
validUsernames.forEach((username) => {
this.ignore(username, true);
const user = this.users.get(username);
if (user) this.autocomplete.remove(user.displayName, true);
});
const resultArray = Array.from(validUsernames.values());
const resultMessage =
Expand Down Expand Up @@ -1677,6 +1680,8 @@ class Chat {
if (!failure) {
validUsernames.forEach((username) => {
this.ignore(username, false);
const user = this.users.get(username);
if (user) this.autocomplete.add(user.displayName, false, Date.now());
});
const haveOrHas = parts.length === 1 ? 'has' : 'have';
MessageBuilder.status(
Expand Down

0 comments on commit c64d33d

Please sign in to comment.