Always fill in contact names again

This commit is contained in:
M66B 2019-12-24 09:26:10 +01:00
parent fd223d6d4c
commit 2876e12c7f
1 changed files with 12 additions and 15 deletions

View File

@ -1058,21 +1058,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibAvatar.setTag(lookupUri);
ibAvatar.setEnabled(lookupUri != null);
// Updating in message lists causes jitter
if (viewType == ViewType.THREAD) {
String displayName = info.getDisplayName();
if (!TextUtils.isEmpty(displayName) &&
addresses != null && addresses.length == 1) {
String email = ((InternetAddress) addresses[0]).getAddress();
String personal = ((InternetAddress) addresses[0]).getPersonal();
if (TextUtils.isEmpty(personal) || !personal.equals(displayName))
try {
InternetAddress a = new InternetAddress(email, displayName);
tvFrom.setText(MessageHelper.formatAddresses(new Address[]{a}, name_email, false));
} catch (UnsupportedEncodingException ex) {
Log.w(ex);
}
}
String displayName = info.getDisplayName();
if (!TextUtils.isEmpty(displayName) &&
addresses != null && addresses.length == 1) {
String email = ((InternetAddress) addresses[0]).getAddress();
String personal = ((InternetAddress) addresses[0]).getPersonal();
if (TextUtils.isEmpty(personal))
try {
InternetAddress a = new InternetAddress(email, displayName, StandardCharsets.UTF_8.name());
tvFrom.setText(MessageHelper.formatAddresses(new Address[]{a}, name_email, false));
} catch (UnsupportedEncodingException ex) {
Log.w(ex);
}
}
if (distinguish_contacts && info.isKnown())