| 596 | } |
| 597 | |
| 598 | jsi::Value CommRustModule::uploadOneTimeKeys( |
| 599 | jsi::Runtime &rt, |
| 600 | jsi::String authUserID, |
| 601 | jsi::String authDeviceID, |
| 602 | jsi::String authAccessToken, |
| 603 | jsi::Array contentOneTimePreKeys, |
| 604 | jsi::Array notifOneTimePreKeys) { |
| 605 | auto authUserIDRust = jsiStringToRustString(authUserID, rt); |
| 606 | auto authDeviceIDRust = jsiStringToRustString(authDeviceID, rt); |
| 607 | auto authAccessTokenRust = jsiStringToRustString(authAccessToken, rt); |
| 608 | auto contentOneTimePreKeysRust = |
| 609 | jsiStringArrayToRustVec(contentOneTimePreKeys, rt); |
| 610 | auto notifOneTimePreKeysRust = |
| 611 | jsiStringArrayToRustVec(notifOneTimePreKeys, rt); |
| 612 | |
| 613 | return createPromiseAsJSIValue( |
| 614 | rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 615 | std::string error; |
| 616 | try { |
| 617 | auto currentID = RustPromiseManager::instance.addPromise( |
| 618 | {promise, this->jsInvoker_, innerRt}); |
| 619 | identityUploadOneTimeKeys( |
| 620 | authUserIDRust, |
| 621 | authDeviceIDRust, |
| 622 | authAccessTokenRust, |
| 623 | contentOneTimePreKeysRust, |
| 624 | notifOneTimePreKeysRust, |
| 625 | currentID); |
| 626 | } catch (const std::exception &e) { |
| 627 | error = e.what(); |
| 628 | }; |
| 629 | if (!error.empty()) { |
| 630 | this->jsInvoker_->invokeAsync( |
| 631 | [error, promise]() { promise->reject(error); }); |
| 632 | } |
| 633 | }); |
| 634 | } |
| 635 | |
| 636 | jsi::Value CommRustModule::getKeyserverKeys( |
| 637 | jsi::Runtime &rt, |
nothing calls this directly
no test coverage detected