parent
cdf4f83392
commit
fcc1de962e
1 changed files with 5 additions and 14 deletions
|
|
@ -182,21 +182,12 @@ const successfulHandshakeAlreadyExists = async recipientPub => {
|
|||
* @returns {Promise<string|null>}
|
||||
*/
|
||||
const recipientToOutgoingID = async recipientPub => {
|
||||
const maybeEncryptedOutgoingID = await tryAndWait(async (_, user) => {
|
||||
const oid = await user
|
||||
const maybeEncryptedOutgoingID = await require('../../Mediator/index')
|
||||
.getUser()
|
||||
.get(Key.RECIPIENT_TO_OUTGOING)
|
||||
.get(recipientPub)
|
||||
.then()
|
||||
|
||||
if (typeof oid !== 'string' && oid !== null) {
|
||||
throw new Error(
|
||||
'Expected outgoing id from recipient-to-outgoing-id map to be an string or null'
|
||||
)
|
||||
}
|
||||
|
||||
return oid
|
||||
})
|
||||
|
||||
if (typeof maybeEncryptedOutgoingID === 'string') {
|
||||
const outgoingID = await require('../../Mediator/index').mySEA.decrypt(
|
||||
maybeEncryptedOutgoingID,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue