Show the full reply chain in the 'see replies' bottom sheet.

This commit is contained in:
Greyson Parrelli
2022-07-01 13:36:54 -04:00
committed by GitHub
parent a44c3c5c2f
commit daab296172
6 changed files with 59 additions and 16 deletions

View File

@@ -45,6 +45,7 @@ import java.io.Closeable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -307,9 +308,20 @@ public class MmsSmsDatabase extends Database {
MessageRecord record;
while ((record = reader.getNext()) != null) {
records.add(record);
records.addAll(getAllMessagesThatQuote(new MessageId(record.getId(), record.isMms())));
}
}
Collections.sort(records, (lhs, rhs) -> {
if (lhs.getDateReceived() > rhs.getDateReceived()) {
return -1;
} else if (lhs.getDateReceived() < rhs.getDateReceived()) {
return 1;
} else {
return 0;
}
});
return records;
}

View File

@@ -158,6 +158,13 @@ public class MediaMmsMessageRecord extends MmsMessageRecord {
getNotifiedTimestamp(), getViewedReceiptCount(), getReceiptTimestamp(), getMessageRanges(), getStoryType(), getParentStoryId(), getGiftBadge());
}
public @NonNull MediaMmsMessageRecord withoutQuote() {
return new MediaMmsMessageRecord(getId(), getRecipient(), getIndividualRecipient(), getRecipientDeviceId(), getDateSent(), getDateReceived(), getServerTimestamp(), getDeliveryReceiptCount(), getThreadId(), getBody(), getSlideDeck(),
getPartCount(), getType(), getIdentityKeyMismatches(), getNetworkFailures(), getSubscriptionId(), getExpiresIn(), getExpireStarted(), isViewOnce(),
getReadReceiptCount(), null, getSharedContacts(), getLinkPreviews(), isUnidentified(), getReactions(), isRemoteDelete(), mentionsSelf,
getNotifiedTimestamp(), getViewedReceiptCount(), getReceiptTimestamp(), getMessageRanges(), getStoryType(), getParentStoryId(), getGiftBadge());
}
public @NonNull MediaMmsMessageRecord withAttachments(@NonNull Context context, @NonNull List<DatabaseAttachment> attachments) {
Map<AttachmentId, DatabaseAttachment> attachmentIdMap = new HashMap<>();
for (DatabaseAttachment attachment : attachments) {