From ba8852930d43e63773e8647e1528a3b4fa8600db Mon Sep 17 00:00:00 2001 From: Hocuri Date: Thu, 13 Apr 2023 17:36:04 +0200 Subject: [PATCH] Show verified icon exactly when the 1:1 chat is verified (#2541) --- .../securesms/ConversationTitleView.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationTitleView.java b/src/org/thoughtcrime/securesms/ConversationTitleView.java index 8f7f30bd9..cc0aabda7 100644 --- a/src/org/thoughtcrime/securesms/ConversationTitleView.java +++ b/src/org/thoughtcrime/securesms/ConversationTitleView.java @@ -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); }