Add more pin message checks.

This commit is contained in:
Michelle Tang
2026-03-16 12:20:21 -04:00
parent ecbf9d60cb
commit 1b3fb60cb0

View File

@@ -1316,6 +1316,11 @@ object DataMessageProcessor {
return null
}
if (targetThread.recipient.id != threadRecipient.id) {
warn(envelope.timestamp!!, "[handlePinMessage] Target message is in a different thread than the thread recipient! timestamp: ${pinMessage.targetSentTimestamp}")
return null
}
val groupRecord = SignalDatabase.groups.getGroup(threadRecipient.id).orNull()
if (groupRecord != null && !groupRecord.members.contains(senderRecipient.id)) {
warn(envelope.timestamp!!, "[handlePinMessage] Sender is not in the group! timestamp: ${pinMessage.targetSentTimestamp}")
@@ -1408,6 +1413,11 @@ object DataMessageProcessor {
return null
}
if (targetThread.recipient.id != threadRecipient.id) {
warn(envelope.timestamp!!, "[handleUnpinMessage] Target message is in a different thread than the thread recipient! timestamp: ${unpinMessage.targetSentTimestamp}")
return null
}
val groupRecord = SignalDatabase.groups.getGroup(threadRecipient.id).orNull()
if (groupRecord != null && !groupRecord.members.contains(senderRecipient.id)) {
warn(envelope.timestamp!!, "[handleUnpinMessage] Sender is not in the group! timestamp: ${unpinMessage.targetSentTimestamp}")