Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement nip17 DM handling with user-initiated decryption #243

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aybanda
Copy link

@aybanda aybanda commented Sep 30, 2024

 This PR implements handling for nip17 direct messages in the chat interface. 
 Users are prompted for decryption when receiving encrypted messages. 
 The feature includes:
 - User-initiated decryption for nip17 DMs
 - Display of decrypted messages in the chat interface

@aybanda aybanda mentioned this pull request Sep 30, 2024
Comment on lines +50 to +51
const userResponse = window.confirm(`Do you want to decrypt this message: ${message.content}?`);
resolve(userResponse);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way this is now, I get bombarded with at least 50 alert windows to confirm something when opening a chat with less than 50 messages.

image

I suspect @hzrd149 sees a problem with nip17 integration in that prior to decryption, it is not clear who's message we are decrypting as the sender is anonymous at that point.

But as there is absolutely no way of knowing not even the timestamp of the message as per nip17 that is also supposed to be fuzzy, the user will get prompted to decrypt all messages from friends or foes alike? That's not practical.

For what it's worth, I forbade the popup to appear again and clicked on decrypt-all above, which gave me no nip17 messages although there should be some on that friend's chat. I had not analyzed the code to that detail on whither these nip17 messages should be intermixed with nip4 but I suppose that's how it should work eventually.

Copy link

@Giszmo Giszmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see nothing in the code that would allow authoring nip17 events. I guess this is still a draft?

@aybanda aybanda marked this pull request as draft October 1, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants