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

MXCrypto: Use the last olm session that got a message #611

Merged
merged 5 commits into from
Dec 20, 2018
Merged

Conversation

manuroe
Copy link
Contributor

@manuroe manuroe commented Dec 20, 2018

MXRealmOlmSession *realmOlmSession = [MXRealmOlmSession objectsInRealm:self.realm
where:@"sessionId = %@ AND deviceKey = %@", sessionId, deviceKey].firstObject;

OLMSession *olmSession = [NSKeyedUnarchiver unarchiveObjectWithData:realmOlmSession.olmSessionData];
Copy link
Contributor

Choose a reason for hiding this comment

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

- [NSKeyedUnarchiver unarchiveObjectWithData] take a non null argument. Verify realmOlmSession nullability before.

@manuroe manuroe merged commit c5732c6 into develop Dec 20, 2018
@manuroe manuroe deleted the riot_2128 branch December 20, 2018 16:36
device.

@param deviceKey the public key of the other device.
@return {object} A map from sessionId to Base64 end-to-end session.
@return a array of end-to-end sessions sorted by the last updated first.
Copy link

Choose a reason for hiding this comment

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

Wrong comment?

device sorted by `lastReceivedMessageTs`, the most recent(higest value) first.

@param deviceKey the public key of the other device.
@return a array of end-to-end sessions.
Copy link

Choose a reason for hiding this comment

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

result is sorted (comments mixed up)


/**
Retrieve all end-to-end sessions between the logged-in user and another
device sorted by `lastReceivedMessageTs`, the most recent(higest value) first.
Copy link

Choose a reason for hiding this comment

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

typo: highest

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.

Use the last olm session that got a message
3 participants