| 506 | } |
| 507 | |
| 508 | jsi::Value CommRustModule::getOutboundKeysForUser( |
| 509 | jsi::Runtime &rt, |
| 510 | jsi::String authUserID, |
| 511 | jsi::String authDeviceID, |
| 512 | jsi::String authAccessToken, |
| 513 | jsi::String userID, |
| 514 | jsi::Array selectedDeviceIDs) { |
| 515 | auto authUserIDRust = jsiStringToRustString(authUserID, rt); |
| 516 | auto authDeviceIDRust = jsiStringToRustString(authDeviceID, rt); |
| 517 | auto authAccessTokenRust = jsiStringToRustString(authAccessToken, rt); |
| 518 | auto userIDRust = jsiStringToRustString(userID, rt); |
| 519 | auto selectedDeviceIDsRust = jsiStringArrayToRustVec(selectedDeviceIDs, rt); |
| 520 | |
| 521 | return createPromiseAsJSIValue( |
| 522 | rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 523 | std::string error; |
| 524 | try { |
| 525 | auto currentID = RustPromiseManager::instance.addPromise( |
| 526 | {promise, this->jsInvoker_, innerRt}); |
| 527 | identityGetOutboundKeysForUser( |
| 528 | authUserIDRust, |
| 529 | authDeviceIDRust, |
| 530 | authAccessTokenRust, |
| 531 | userIDRust, |
| 532 | selectedDeviceIDsRust, |
| 533 | currentID); |
| 534 | } catch (const std::exception &e) { |
| 535 | error = e.what(); |
| 536 | }; |
| 537 | if (!error.empty()) { |
| 538 | this->jsInvoker_->invokeAsync( |
| 539 | [error, promise]() { promise->reject(error); }); |
| 540 | } |
| 541 | }); |
| 542 | } |
| 543 | |
| 544 | jsi::Value CommRustModule::getInboundKeysForUser( |
| 545 | jsi::Runtime &rt, |
nothing calls this directly
no test coverage detected