Ensure direct replies respect disappearing message timeout.
This commit is contained in:
parent
ab031d3dad
commit
631720f111
2 changed files with 15 additions and 9 deletions
|
@ -1501,6 +1501,7 @@ public final class MessageContentProcessor {
|
|||
RecipientId storyAuthorRecipient = RecipientId.from(storyContext.getAuthorServiceId(), null);
|
||||
ParentStoryId parentStoryId;
|
||||
QuoteModel quoteModel = null;
|
||||
long expiresInMillis = 0;
|
||||
try {
|
||||
MessageId storyMessageId = database.getStoryId(storyAuthorRecipient, storyContext.getSentTimestamp());
|
||||
|
||||
|
@ -1511,6 +1512,7 @@ public final class MessageContentProcessor {
|
|||
|
||||
parentStoryId = new ParentStoryId.DirectReply(storyMessageId.getId());
|
||||
quoteModel = new QuoteModel(storyContext.getSentTimestamp(), storyAuthorRecipient, "", false, story.getSlideDeck().asAttachments(), Collections.emptyList());
|
||||
expiresInMillis = TimeUnit.SECONDS.toMillis(message.getExpiresInSeconds());
|
||||
} else {
|
||||
warn(content.getTimestamp(), "Story has reactions disabled. Dropping reaction.");
|
||||
return;
|
||||
|
@ -1528,7 +1530,7 @@ public final class MessageContentProcessor {
|
|||
parentStoryId,
|
||||
true,
|
||||
-1,
|
||||
0,
|
||||
expiresInMillis,
|
||||
false,
|
||||
false,
|
||||
content.isNeedsReceipt(),
|
||||
|
@ -1571,6 +1573,8 @@ public final class MessageContentProcessor {
|
|||
RecipientId storyAuthorRecipient = RecipientId.from(storyContext.getAuthorServiceId(), null);
|
||||
ParentStoryId parentStoryId;
|
||||
QuoteModel quoteModel = null;
|
||||
long expiresInMillis = 0L;
|
||||
|
||||
try {
|
||||
MessageId storyMessageId = database.getStoryId(storyAuthorRecipient, storyContext.getSentTimestamp());
|
||||
MmsMessageRecord story = (MmsMessageRecord) database.getMessageRecord(storyMessageId.getId());
|
||||
|
@ -1582,6 +1586,7 @@ public final class MessageContentProcessor {
|
|||
} else if (groupStory || SignalDatabase.storySends().canReply(senderRecipient.getId(), storyContext.getSentTimestamp())) {
|
||||
parentStoryId = new ParentStoryId.DirectReply(storyMessageId.getId());
|
||||
quoteModel = new QuoteModel(storyContext.getSentTimestamp(), groupStory ? threadRecipient.getId() : storyAuthorRecipient, "", false, story.getSlideDeck().asAttachments(), Collections.emptyList());
|
||||
expiresInMillis = TimeUnit.SECONDS.toMillis(message.getExpiresInSeconds());
|
||||
} else {
|
||||
warn(content.getTimestamp(), "Story has replies disabled. Dropping reply.");
|
||||
return;
|
||||
|
@ -1599,7 +1604,7 @@ public final class MessageContentProcessor {
|
|||
parentStoryId,
|
||||
false,
|
||||
-1,
|
||||
0,
|
||||
expiresInMillis,
|
||||
false,
|
||||
false,
|
||||
content.isNeedsReceipt(),
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.thoughtcrime.securesms.mms.QuoteModel
|
|||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.sms.MessageSender
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class StoryDirectReplyRepository(context: Context) {
|
||||
|
||||
|
@ -49,7 +50,7 @@ class StoryDirectReplyRepository(context: Context) {
|
|||
emptyList(),
|
||||
System.currentTimeMillis(),
|
||||
0,
|
||||
0L,
|
||||
TimeUnit.SECONDS.toMillis(recipient.expiresInSeconds.toLong()),
|
||||
false,
|
||||
0,
|
||||
StoryType.NONE,
|
||||
|
|
Loading…
Add table
Reference in a new issue