Show verified icon exactly when the 1:1 chat is verified (#2541)

This commit is contained in:
Hocuri
2023-04-13 17:36:04 +02:00
committed by GitHub
parent 343843966f
commit ba8852930d
@@ -107,9 +107,6 @@ public class ConversationTitleView extends RelativeLayout {
else {
DcContact dcContact = dcContext.getContact(chatContacts[0]);
subtitleStr = dcContact.getAddr();
if (dcContact.isVerified()) {
imgRight = R.drawable.ic_verified;
}
isOnline = dcContact.wasSeenRecently();
}
}
@@ -130,12 +127,19 @@ public class ConversationTitleView extends RelativeLayout {
}
public void setTitle(@NonNull GlideRequests glideRequests, @NonNull DcContact contact) {
// the verified state is _not_ shown in the title. this will be confusing as in the one-to-one-ChatViews, the verified
// icon is also not shown as these chats are always opportunistic chats
// This function is only called for contacts without a corresponding 1:1 chat.
// If there is a 1:1 chat, then the overloaded function
// setTitle(GlideRequests, DcChat, boolean) is called.
avatar.setAvatar(glideRequests, new Recipient(getContext(), contact), false);
avatar.setSeenRecently(contact.wasSeenRecently());
int imgRight = 0;
if (contact.isVerified()) {
imgRight = R.drawable.ic_verified;
}
title.setText(contact.getDisplayName());
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, imgRight, 0);
subtitle.setText(contact.getAddr());
subtitle.setVisibility(View.VISIBLE);
}