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

Friend request fixes #50

Merged
merged 17 commits into from Nov 22, 2018
Merged

Friend request fixes #50

merged 17 commits into from Nov 22, 2018

Conversation

Mikunj
Copy link

@Mikunj Mikunj commented Nov 21, 2018

This PR fixes the logic issues with the previously implemented friend request.

I also refactored some things and moved the logic of adding friend requests out into message_receiver and background

The new logic is the following:

isFriend = Whether we are friends
isKeyExchanged = No cipher text received

  • If not isFriend then use fallback encryption.
    • This sets the message type to FRIEND_REQUEST.
  • For every message sent, if not isKeyExchanged then we attach preKeyBundle to the Envelope.
    • preKeyBundle used to be inside the Envelope content but was moved outside of it.
    • preKeyBundle is always encrypted using the fallback encryption.
  • If we get an encrypted message from the other user then set isKeyExchanged to true.

Copy link

@sachaaaaa sachaaaaa left a comment

Choose a reason for hiding this comment

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

Great refactoring.
Just a couple of points to address below.

js/models/conversations.js Outdated Show resolved Hide resolved
js/models/conversations.js Outdated Show resolved Hide resolved
libtextsecure/message_receiver.js Show resolved Hide resolved
js/models/conversations.js Outdated Show resolved Hide resolved
js/models/conversations.js Show resolved Hide resolved
@sachaaaaa sachaaaaa merged commit dbdd52b into oxen-io:development Nov 22, 2018
@Mikunj Mikunj deleted the fix/friend-request branch November 23, 2018 04:57
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.

None yet

2 participants