1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-15 19:27:31 +00:00

close #1388 (i think)

This commit is contained in:
Austin Huang 2021-06-04 15:34:29 -04:00
parent 4a72d64a6d
commit 8e1d5c66bd
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F

View File

@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableList;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle; import java.time.format.FormatStyle;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -164,7 +165,9 @@ public abstract class DirectItemViewHolder extends RecyclerView.ViewHolder imple
binding.ivProfilePic.setVisibility(messageDirection == MessageDirection.INCOMING && thread.isGroup() ? View.VISIBLE : View.GONE); binding.ivProfilePic.setVisibility(messageDirection == MessageDirection.INCOMING && thread.isGroup() ? View.VISIBLE : View.GONE);
binding.tvUsername.setVisibility(messageDirection == MessageDirection.INCOMING && thread.isGroup() ? View.VISIBLE : View.GONE); binding.tvUsername.setVisibility(messageDirection == MessageDirection.INCOMING && thread.isGroup() ? View.VISIBLE : View.GONE);
if (messageDirection == MessageDirection.INCOMING && thread.isGroup()) { if (messageDirection == MessageDirection.INCOMING && thread.isGroup()) {
final User user = getUser(item.getUserId(), thread.getUsers()); final List<User> allUsers = new LinkedList(thread.getUsers());
allUsers.addAll(thread.getLeftUsers());
final User user = getUser(item.getUserId(), allUsers);
if (user != null) { if (user != null) {
binding.tvUsername.setText(user.getUsername()); binding.tvUsername.setText(user.getUsername());
binding.ivProfilePic.setImageURI(user.getProfilePicUrl()); binding.ivProfilePic.setImageURI(user.getProfilePicUrl());
@ -220,7 +223,9 @@ public abstract class DirectItemViewHolder extends RecyclerView.ViewHolder imple
private void setupReply(final DirectItem item, final MessageDirection messageDirection) { private void setupReply(final DirectItem item, final MessageDirection messageDirection) {
if (item.getRepliedToMessage() != null) { if (item.getRepliedToMessage() != null) {
setReply(item, messageDirection, thread.getUsers()); final List<User> allUsers = new LinkedList(thread.getUsers());
allUsers.addAll(thread.getLeftUsers());
setReply(item, messageDirection, allUsers);
} else { } else {
binding.quoteLine.setVisibility(View.GONE); binding.quoteLine.setVisibility(View.GONE);
binding.replyContainer.setVisibility(View.GONE); binding.replyContainer.setVisibility(View.GONE);