Merge pull request #2267 from nextcloud/fixStatusVisibility

Fix status visibility in conversation list
This commit is contained in:
Andy Scherzinger 2022-08-04 13:57:45 +02:00 committed by GitHub
commit 23e3f323f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,7 +97,7 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
public boolean equals(Object o) {
if (o instanceof ConversationItem) {
ConversationItem inItem = (ConversationItem) o;
return conversation.equals(inItem.getModel());
return conversation.equals(inItem.getModel()) && status.equals(inItem.status);
}
return false;
}
@ -108,7 +108,9 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
@Override
public int hashCode() {
return conversation.hashCode();
int result = conversation.hashCode();
result = 31 * result + (status != null ? status.hashCode() : 0);
return result;
}
@Override
@ -211,12 +213,16 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
if (status != null && Conversation.ConversationType.ROOM_SYSTEM != conversation.getType()) {
float size = DisplayUtils.convertDpToPixel(STATUS_SIZE_IN_DP, appContext);
holder.binding.userStatusImage.setVisibility(View.VISIBLE);
holder.binding.userStatusImage.setImageDrawable(new StatusDrawable(
status.getStatus(),
status.getIcon(),
size,
context.getResources().getColor(R.color.bg_default),
appContext));
} else {
holder.binding.userStatusImage.setVisibility(View.GONE);
}
if (conversation.getLastMessage() != null) {