Merge pull request #1863 from PR0M3TH3AN/incremental-dm-delivery-1675115114580049093

Incremental DM Delivery
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-27 19:14:16 -05:00
commit 63e5c9f415
3 files changed
+14 -1

No files matched your search

+7
View File
@@ -4480,6 +4480,13 @@ export class NostrClient {
});
if (decrypted?.ok) {
messages.push(decrypted);
if (typeof options.onMessage === "function") {
try {
options.onMessage(decrypted);
} catch (error) {
devLogger.warn("[nostr] onMessage callback threw:", error);
}
}
}
} catch (error) {
devLogger.warn("[nostr] Failed to decrypt DM event during list.", {
+3
View File
@@ -958,6 +958,9 @@ export class NostrService {
...options,
limit: resolvedLimit,
decryptLimit: resolvedDecryptLimit,
onMessage: (message) => {
this.applyDirectMessage(message, { reason: "load-incremental" });
},
});
} catch (error) {
userLogger.warn("[nostrService] Failed to load direct messages", error);
+4 -1
View File
@@ -4970,7 +4970,10 @@ export class ProfileModalController {
}
handleDirectMessagesUpdated(detail = {}) {
if (this.activeMessagesRequest) {
if (
this.activeMessagesRequest &&
detail?.reason !== "load-incremental"
) {
return;
}