You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Olm session creation async
This commit is contained in:
@@ -305,7 +305,7 @@ OlmDevice.prototype.generateOneTimeKeys = async function(numKeys) {
|
|||||||
* @param {string} theirOneTimeKey remote user's one-time Curve25519 key
|
* @param {string} theirOneTimeKey remote user's one-time Curve25519 key
|
||||||
* @return {string} sessionId for the outbound session.
|
* @return {string} sessionId for the outbound session.
|
||||||
*/
|
*/
|
||||||
OlmDevice.prototype.createOutboundSession = function(
|
OlmDevice.prototype.createOutboundSession = async function(
|
||||||
theirIdentityKey, theirOneTimeKey,
|
theirIdentityKey, theirOneTimeKey,
|
||||||
) {
|
) {
|
||||||
const self = this;
|
const self = this;
|
||||||
@@ -335,7 +335,7 @@ OlmDevice.prototype.createOutboundSession = function(
|
|||||||
* @raises {Error} if the received message was not valid (for instance, it
|
* @raises {Error} if the received message was not valid (for instance, it
|
||||||
* didn't use a valid one-time key).
|
* didn't use a valid one-time key).
|
||||||
*/
|
*/
|
||||||
OlmDevice.prototype.createInboundSession = function(
|
OlmDevice.prototype.createInboundSession = async function(
|
||||||
theirDeviceIdentityKey, message_type, ciphertext,
|
theirDeviceIdentityKey, message_type, ciphertext,
|
||||||
) {
|
) {
|
||||||
if (message_type !== 0) {
|
if (message_type !== 0) {
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ OlmDecryption.prototype._decryptMessage = async function(
|
|||||||
|
|
||||||
let res;
|
let res;
|
||||||
try {
|
try {
|
||||||
res = this._olmDevice.createInboundSession(
|
res = await this._olmDevice.createInboundSession(
|
||||||
theirDeviceIdentityKey, message.type, message.body,
|
theirDeviceIdentityKey, message.type, message.body,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ async function _verifyKeyAndStartSession(olmDevice, oneTimeKey, userId, deviceIn
|
|||||||
|
|
||||||
let sid;
|
let sid;
|
||||||
try {
|
try {
|
||||||
sid = olmDevice.createOutboundSession(
|
sid = await olmDevice.createOutboundSession(
|
||||||
deviceInfo.getIdentityKey(), oneTimeKey.key,
|
deviceInfo.getIdentityKey(), oneTimeKey.key,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user