muke1908 / chat-e2ee

End-to-end encrypted disposable chat sessions, exchange sensitive information with peer safely and securely.
https://chat-e2ee-2.azurewebsites.net/
Apache License 2.0
322 stars 196 forks source link

Allow user to set nickname #326

Closed muke1908 closed 1 year ago

muke1908 commented 1 year ago

Right now the nickname is hard-coded as Alice.Pass an optional param, username, in setChannel method (channelId: string, userId: string, userName?: string);

https://github.com/muke1908/chat-e2ee/blob/114a99d50baa587cad7c603a24610df2c3cc5ca4/service/src/sdk.ts#L79

Scope of this ticket: 1 - add 3rd optional param in setChannel 2 - store it in a private variable in ChatE2EE class.

karandeep4423 commented 1 year ago

could you assign me this issue?

karandeep4423 commented 1 year ago

hi, you want that i write these two lines only or should write compelete code for frontend and backend as well, like there would be input place in frontend where user can type his name. Kindly expain me in a detail, as it is my first contribution in open source project so kindly corporate

muke1908 commented 1 year ago

@karandeep4423 It would be great if you also can add the frontend. Like: a Input box on the left side of "create chat link" button. ++ chages mentioned in this issue.

The backend is not in the scope of this ticket. Probably backend would not be involved at all. I'll create a separate issue that involves handling the nickname and exchanging the nickname with the participant.

Yashita1512 commented 1 year ago

Is anybody working on this issue currently? Please make a PR. If not, @muke1908 may I please work on this issue?

muke1908 commented 1 year ago

@Yashita1512 Not sure if @karandeep4423 is working. Can you confirm if you are working on it (@karandeep4423 )?

Yashita1512 commented 1 year ago

I will wait until tomorrow for his reply, else I will try solving it. Thankyou for the response @muke1908.

karandeep4423 commented 1 year ago

@muke1908 @Yashita1512 i am working on it

karandeep4423 commented 1 year ago

added below changes, if it is okay then i will make a push request.

it is two line code. added param public async setChannel(channelId: string, userId: string, userName: string): Promise {

and stored class ChatE2EE implements IChatE2EE { private channelId?: string; private userId?: string; private userName?: string;

muke1908 commented 1 year ago

It's fine. You can push it.

karandeep4423 commented 1 year ago

but i did not include in stringfy public async setChannel(channelId: string, userId: string, userName: string): Promise { this.checkInitialized(); logger.log(setChannel(), ${JSON.stringify({ channelId, userId })}); this.channelId = channelId; this.userId = userId; await sharePublicKey({ publicKey: this.publicKey, sender: this.userId, channelId: this.channelId }); this.socket.joinChat({ publicKey: this.publicKey, userID: this.userId, channelID: this.channelId }) await this.getPublicKey(logger); return; }

karandeep4423 commented 1 year ago

let me now , is it okay?

muke1908 commented 1 year ago

Please create a PR. It'll be easy to review there