Fix story linking from private story reply.

This commit is contained in:
clark-signal
2023-01-12 16:23:53 -05:00
committed by Cody Henthorne
parent c3c8f8e7e6
commit 7af94f60ae
2 changed files with 28 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ import org.thoughtcrime.securesms.crypto.SecurityEvent;
import org.thoughtcrime.securesms.database.AttachmentTable;
import org.thoughtcrime.securesms.database.CallTable;
import org.thoughtcrime.securesms.database.GroupTable;
import org.thoughtcrime.securesms.database.StorySendTable;
import org.thoughtcrime.securesms.database.model.GroupRecord;
import org.thoughtcrime.securesms.database.GroupReceiptTable;
import org.thoughtcrime.securesms.database.GroupReceiptTable.GroupReceiptInfo;
@@ -1750,12 +1751,20 @@ public final class MessageContentProcessor {
try {
RecipientId storyAuthorRecipient = RecipientId.from(storyContext.getAuthorServiceId());
RecipientId selfId = Recipient.self().getId();
ParentStoryId parentStoryId;
QuoteModel quoteModel = null;
long expiresInMillis = 0L;
MessageId storyMessageId = null;
try {
MessageId storyMessageId = database.getStoryId(storyAuthorRecipient, storyContext.getSentTimestamp());
if (selfId.equals(storyAuthorRecipient)) {
storyMessageId = SignalDatabase.storySends().getStoryMessageFor(senderRecipient.getId(), storyContext.getSentTimestamp());
}
if (storyMessageId == null) {
storyMessageId = database.getStoryId(storyAuthorRecipient, storyContext.getSentTimestamp());
}
MmsMessageRecord story = (MmsMessageRecord) database.getMessageRecord(storyMessageId.getId());
Recipient threadRecipient = Objects.requireNonNull(SignalDatabase.threads().getRecipientForThreadId(story.getThreadId()));
boolean groupStory = threadRecipient.isActiveGroup();