Improve group story reply and reaction validations.

This commit is contained in:
Greyson Parrelli
2026-06-05 20:00:22 +00:00
committed by Cody Henthorne
parent 3d05bc3471
commit d33385d1b2
@@ -428,6 +428,14 @@ object DataMessageProcessor {
try {
val storyId = SignalDatabase.messages.getStoryId(authorRecipientId, sentTimestamp).id
val storyThreadRecipient: Recipient = SignalDatabase.threads.getRecipientForThreadId(SignalDatabase.messages.getMessageRecord(storyId).threadId)!!
val storyGroupRecord: GroupRecord? = SignalDatabase.groups.getGroup(storyThreadRecipient.id).orNull()
val storyGroupId: GroupId? = storyGroupRecord?.id?.takeIf { storyGroupRecord.isActive }
if (storyGroupId != groupId) {
warn(envelope.clientTimestamp!!, "Story reaction target does not belong to the same conversation as the incoming message. Dropping reaction.")
return null
}
if (groupId != null) {
parentStoryId = GroupReply(storyId)
} else if (SignalDatabase.storySends.canReply(senderRecipientId, sentTimestamp)) {
@@ -748,6 +756,12 @@ object DataMessageProcessor {
val groupRecord: GroupRecord? = SignalDatabase.groups.getGroup(threadRecipient.id).orNull()
val groupStory: Boolean = groupRecord?.isActive ?: false
val storyGroupId: GroupId? = groupRecord?.id?.takeIf { groupStory }
if (storyGroupId != groupId) {
warn(envelope.clientTimestamp!!, "Story reply target does not belong to the same conversation as the incoming message. Dropping reply.")
return null
}
if (!groupStory) {
threadRecipient = senderRecipient
}