mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Show verified icon exactly when the 1:1 chat is verified (#2541)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user