@whanext/core 0.19.8 → 0.19.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.9
4
+
5
+ - Fixed live `message_addon` edits being discarded when Zapo reports the parent message timestamp instead of the mutation timestamp.
6
+ - Serialized decrypted edit addons through the same protocol-mutation queue used by `message_protocol`, preserving edit/revoke ordering.
7
+ - Offline-resume edit addons remain ignored by default unless `processOfflineMessages` is enabled.
8
+
3
9
  ## 0.19.8
4
10
 
5
11
  ### Fixed
package/dist/index.js CHANGED
@@ -3199,9 +3199,18 @@ var ZapoProvider = class {
3199
3199
  ...protocolKey?.participant !== void 0 ? { participant: protocolKey.participant } : event.key.participant !== void 0 ? { participant: event.key.participant } : {},
3200
3200
  ...protocolKey?.participantAlt !== void 0 ? { participantAlt: protocolKey.participantAlt } : event.key.participantAlt !== void 0 ? { participantAlt: event.key.participantAlt } : {}
3201
3201
  };
3202
- void this.#handleProtocolEvent({
3202
+ if (event.offline === true && this.#options.processOfflineMessages !== true) {
3203
+ this.#logger.debug("Ignored offline Zapo edit addon from before the current live connection.", {
3204
+ messageId: event.key.id ?? void 0,
3205
+ targetMessageId,
3206
+ chatId: target.remoteJid ?? event.key.remoteJid ?? void 0
3207
+ });
3208
+ return;
3209
+ }
3210
+ const mutationTimestampSeconds = toSeconds(protocol?.timestampMs) ?? (event.offline === true ? toSeconds(event.timestampSeconds) : void 0) ?? Math.floor(Date.now() / 1e3);
3211
+ this.#enqueueProtocolEvent({
3203
3212
  key: event.key,
3204
- ...event.timestampSeconds !== void 0 ? { timestampSeconds: event.timestampSeconds } : {},
3213
+ timestampSeconds: mutationTimestampSeconds,
3205
3214
  protocolMessage: {
3206
3215
  type: proto.Message.ProtocolMessage.Type.MESSAGE_EDIT,
3207
3216
  key: target,