@arbidocs/sdk 0.4.110 → 0.4.114

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/dist/index.cjs CHANGED
@@ -6091,6 +6091,7 @@ __export(chats_exports, {
6091
6091
  CHAT_ATTACHMENT_MAX_FILES: () => CHAT_ATTACHMENT_MAX_FILES,
6092
6092
  DECRYPTION_FAILED: () => DECRYPTION_FAILED,
6093
6093
  addChatMembers: () => addChatMembers,
6094
+ chatMessageTombstone: () => chatMessageTombstone,
6094
6095
  checkChatAttachmentLimits: () => checkChatAttachmentLimits,
6095
6096
  createChatCryptoContext: () => createChatCryptoContext,
6096
6097
  createGroupChat: () => createGroupChat,
@@ -6389,7 +6390,21 @@ function keyFor(ring, version) {
6389
6390
  return key;
6390
6391
  }
6391
6392
  var DECRYPTION_FAILED = "[Decryption failed]";
6393
+ function chatMessageTombstone(message) {
6394
+ const row = {
6395
+ ...message,
6396
+ deleted: true,
6397
+ content: null,
6398
+ attachments: null,
6399
+ dedupe_key: null
6400
+ };
6401
+ delete row.decryptFailed;
6402
+ delete row.attachmentFiles;
6403
+ delete row.attachmentsError;
6404
+ return row;
6405
+ }
6392
6406
  async function decryptChatMessage(ring, message) {
6407
+ if (message.deleted) return chatMessageTombstone(message);
6393
6408
  const key = ring.keys.get(message.key_version);
6394
6409
  const row = { ...message };
6395
6410
  if (message.content) {