Admin Delete

This commit is contained in:
Jamie
2026-02-27 11:55:02 -08:00
committed by Yash
parent b71b5570d3
commit e424610cc2
67 changed files with 2328 additions and 569 deletions

View File

@@ -29,6 +29,7 @@ import type {
ProcessedPollVote,
ProcessedPollTerminate,
ProcessedDelete,
ProcessedAdminDelete,
ProcessedGiftBadge,
ProcessedStoryContext,
ProcessedPinMessage,
@@ -424,6 +425,25 @@ export function processDelete(
};
}
export function processAdminDelete(
adminDelete?: Proto.DataMessage.IAdminDelete | null
): ProcessedAdminDelete | undefined {
if (!adminDelete) {
return undefined;
}
const targetSentTimestamp = adminDelete.targetSentTimestamp?.toNumber();
strictAssert(targetSentTimestamp, 'AdminDelete missing targetSentTimestamp');
const targetAuthorAci = fromAciUuidBytes(adminDelete.targetAuthorAciBinary);
strictAssert(targetAuthorAci, 'AdminDelete missing targetAuthorAciBinary');
return {
targetSentTimestamp,
targetAuthorAci,
};
}
export function processGiftBadge(
giftBadge: Proto.DataMessage.IGiftBadge | null | undefined
): ProcessedGiftBadge | undefined {
@@ -534,6 +554,7 @@ export function processDataMessage(
pollVote: processPollVote(message.pollVote),
pollTerminate: processPollTerminate(message.pollTerminate),
delete: processDelete(message.delete),
adminDelete: processAdminDelete(message.adminDelete),
bodyRanges: filterAndClean(message.bodyRanges),
groupCallUpdate: dropNull(message.groupCallUpdate),
storyContext: processStoryContext(message.storyContext),