Skip to content

Commit

Permalink
FAForever#2024 fix a bug when all users of 'chat only' group disappea…
Browse files Browse the repository at this point in the history
…rs for

typing on username search field
  • Loading branch information
IvanPavilionG7 committed Nov 15, 2020
1 parent 2f537b1 commit 0b8cd0c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/main/java/com/faforever/client/chat/UserFilterController.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,18 @@ public void filterUsers() {
}

private boolean filterUser(CategoryOrChatUserListItem userListItem) {
if (userListItem.getCategory() != null) {

// The categories should display in the list independently of a filter
return true;
}

ChatChannelUser user = userListItem.getUser();
return userListItem.getCategory() != null
|| (channelTabController.isUsernameMatch(user)
return channelTabController.isUsernameMatch(user)
&& isInClan(user)
&& isBoundByRating(user)
&& isGameStatusMatch(user)
&& isCountryMatch(user));
&& isCountryMatch(user);
}

private void filterCountry() {
Expand Down Expand Up @@ -177,8 +182,12 @@ boolean isGameStatusMatch(ChatChannelUser chatUser) {
}

boolean isCountryMatch(ChatChannelUser chatUser) {
if (countryFilterField.getText().isEmpty()) {
return true;
}

Optional<Player> playerOptional = chatUser.getPlayer();
if (!playerOptional.isPresent()) {
if (playerOptional.isEmpty()) {
return false;
}

Expand Down

0 comments on commit 0b8cd0c

Please sign in to comment.