Prevent deleted messages from being pinned

Co-authored-by: Jamie <113370520+jamiebuilds-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2026-03-03 13:42:58 -06:00
committed by GitHub
parent 184b9220a3
commit 94a8de04b3
2 changed files with 7 additions and 0 deletions

View File

@@ -224,6 +224,10 @@ function validatePinnedMessageTarget(
return { error: 'Sender does not have access to edit group attributes' };
}
if (message.deletedForEveryone) {
return { error: 'Cannot pin deleted message' };
}
if (isGiftBadge(message)) {
return { error: 'Cannot pin gift badge messages' };
}

View File

@@ -2427,6 +2427,9 @@ export function canPinMessage(
if (!canPinMessages(conversation)) {
return false;
}
if (message.deletedForEveryone) {
return false;
}
if (isGiftBadge(message)) {
return false;
}