nostr-double-ratchet 0.0.19 → 0.0.21

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/src/Session.ts CHANGED
@@ -130,7 +130,7 @@ export class Session {
130
130
  content: encryptedData,
131
131
  kind: MESSAGE_EVENT_KIND,
132
132
  tags: [["header", encryptedHeader]],
133
- created_at: Math.floor(Date.now() / 1000)
133
+ created_at: Math.floor(now / 1000)
134
134
  }, this.state.ourCurrentNostrKey.privateKey);
135
135
 
136
136
  return {event: nostrEvent, innerEvent: rumor as Rumor};
@@ -250,10 +250,8 @@ export class Session {
250
250
  // Check if we have any remaining skipped messages from this sender
251
251
  const hasMoreSkippedMessages = Object.keys(this.state.skippedMessageKeys).some(k => k.startsWith(`${nostrSender}:`));
252
252
  if (!hasMoreSkippedMessages) {
253
- // Clean up header keys and unsubscribe as no more skipped messages from this sender
253
+ // Clean up header keys as no more skipped messages from this sender
254
254
  delete this.state.skippedHeaderKeys[nostrSender];
255
- this.nostrUnsubscribe?.();
256
- this.nostrUnsubscribe = undefined;
257
255
  }
258
256
 
259
257
  return nip44.decrypt(ciphertext, mk);
package/src/types.ts CHANGED
@@ -83,6 +83,8 @@ export const MESSAGE_EVENT_KIND = 30078;
83
83
  */
84
84
  export const INVITE_EVENT_KIND = 30078;
85
85
 
86
+ export const INVITE_RESPONSE_KIND = 1059;
87
+
86
88
  export const CHAT_MESSAGE_KIND = 14;
87
89
 
88
90
  export const MAX_SKIP = 100;