Skip pins of deleted messages.

This commit is contained in:
Michelle Tang
2026-02-27 16:06:43 -05:00
committed by Greyson Parrelli
parent 602ea46b8b
commit 3ef0d3e4a3

View File

@@ -1893,6 +1893,11 @@ object SyncMessageProcessor {
return -1
}
if (targetMessage.isRemoteDelete) {
warn(envelope.timestamp!!, "Cannot pin deleted message")
return -1
}
val targetMessageId = (targetMessage as? MmsMessageRecord)?.latestRevisionId?.id ?: targetMessage.id
val duration = if (pinMessage.pinDurationForever == true) MessageTable.PIN_FOREVER else pinMessage.pinDurationSeconds!!.toLong()
val outgoingMessage = OutgoingMessage.pinMessage(