Prepend from/to to senders/recipients

This commit is contained in:
M66B 2024-05-08 12:59:51 +02:00
parent cd07035e71
commit df5fbe9f35
1 changed files with 16 additions and 4 deletions

View File

@ -8779,12 +8779,24 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (message != null) { if (message != null) {
keyPosition.put(message.id, i); keyPosition.put(message.id, i);
positionKey.put(i, message.id); positionKey.put(i, message.id);
addExtra(message.from, message.extra); addExtra(message.from, message.extra);
if (threading) { if (threading) {
if (message.senders == null || message.senders.length == 0) List<Address> senders = new ArrayList<>();
message.senders = message.from; if (message.from != null)
if (message.recipients == null || message.recipients.length == 0) senders.addAll(Arrays.asList(message.from));
message.recipients = message.to; if (message.senders != null)
senders.addAll(Arrays.asList(message.senders));
message.senders = senders.toArray(new Address[0]);
List<Address> recipients = new ArrayList<>();
if (message.to != null)
recipients.addAll(Arrays.asList(message.to));
if (message.recipients != null)
recipients.addAll(Arrays.asList(message.recipients));
message.recipients = recipients.toArray(new Address[0]);
addExtra(message.senders, message.extra); addExtra(message.senders, message.extra);
} else { } else {
message.senders = message.from; message.senders = message.from;