[core] message.revoked - add revokedMessageId - NOWEB, GOWS

This commit is contained in:
devlikepro committed 2025-06-16 13:05:17 +07:00
1 parent c2b275fd90
commit 6dcdd15b1c
4 files changed
+16

No files matched your search

@@ -419,9 +419,12 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
}),
mergeMap(async (message): Promise<WAMessageRevokedBody> => {
const afterMessage = await this.toWAMessage(message);
// Extract the revoked message ID from protocolMessage.key
const revokedMessageId = message.Message.protocolMessage.key?.ID;
return {
after: afterMessage,
before: null,
revokedMessageId: revokedMessageId,
_data: message,
};
}),
@@ -1831,9 +1831,12 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
),
mergeMap(async (message): Promise<WAMessageRevokedBody> => {
const afterMessage = await this.toWAMessage(message);
// Extract the revoked message ID from protocolMessage.key
const revokedMessageId = message.message.protocolMessage.key?.id;
return {
after: afterMessage,
before: null,
revokedMessageId: revokedMessageId,
_data: message,
};
}),
@@ -1418,9 +1418,12 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
const beforeMessage = event.before
? this.toWAMessage(event.before)
: null;
// Extract the revoked message ID from the before message
const revokedMessageId = beforeMessage?.id;
return {
after: afterMessage,
before: beforeMessage,
revokedMessageId: revokedMessageId,
};
}),
);
+7
View File
@@ -93,6 +93,13 @@ export class PollVotePayload {
export class WAMessageRevokedBody {
after?: WAMessage;
before?: WAMessage;
@ApiProperty({
description: 'ID of the message that was revoked',
example: 'A06CA7BB5DD8C8F705628CDB7E3A33C9',
})
revokedMessageId?: string;
_data?: any;
}