feat: working response loop. ensure nip44 everywhere for the key tag

This commit is contained in:
complex 2025-04-09 21:05:44 +02:00
parent 75cec4f063
commit a0fb2fa57e
3 changed files with 26 additions and 8 deletions
client
server/src

@ -92,6 +92,30 @@ User-Agent: Browser/1.0
</div>
</div>
</div>
<!-- Events List Section -->
<div class="events-section">
<h2>Events</h2>
<div class="events-container">
<div class="events-sidebar">
<div id="eventsList" class="events-list">
<div class="empty-state">
No events received yet.
</div>
<!-- Events will be displayed here -->
</div>
</div>
<div class="events-content">
<div id="eventDetails" class="event-details">
<div class="empty-state">
Select an event to view details
</div>
<!-- Selected event details will be shown here -->
</div>
</div>
</div>
</div>
</body>
</html>

@ -523,13 +523,7 @@ async function subscribeToEventResponses(eventId: string, relayUrl: string): Pro
// Update UI to show we received a response
updateUIForWaitingResponse(eventId, false);
// Process the event using the receiver module's functionality
// We need to access the processEvent function from receiver.ts
// Since it's not exported, we'll use a custom event to communicate
const customEvent = new CustomEvent('processNostrEvent', {
detail: data[2]
});
document.dispatchEvent(customEvent);
processEvent(data[2]);
// Unsubscribe after receiving a response
if (!unsubscribed) {

@ -344,7 +344,7 @@ export class NostrHttpServer {
private async encryptContent(pubkey: string, content: string): Promise<string | null> {
try {
const user = new NDKUser({ pubkey });
return await this.ndk.signer?.encrypt(user, content) || null;
return await this.ndk.signer?.encrypt(user, content, 'nip44') || null;
} catch (error) {
console.error('Encryption error:', error);
return null;