| 1036 | } |
| 1037 | |
| 1038 | jsi::Value CommRustModule::findUserIdentities( |
| 1039 | jsi::Runtime &rt, |
| 1040 | jsi::String authUserID, |
| 1041 | jsi::String authDeviceID, |
| 1042 | jsi::String authAccessToken, |
| 1043 | jsi::Array userIDs) { |
| 1044 | auto authUserIDRust = jsiStringToRustString(authUserID, rt); |
| 1045 | auto authDeviceIDRust = jsiStringToRustString(authDeviceID, rt); |
| 1046 | auto authAccessTokenRust = jsiStringToRustString(authAccessToken, rt); |
| 1047 | auto userIDsRust = jsiStringArrayToRustVec(userIDs, rt); |
| 1048 | |
| 1049 | return createPromiseAsJSIValue( |
| 1050 | rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 1051 | std::string error; |
| 1052 | try { |
| 1053 | auto currentID = RustPromiseManager::instance.addPromise( |
| 1054 | {promise, this->jsInvoker_, innerRt}); |
| 1055 | identityFindUserIdentities( |
| 1056 | authUserIDRust, |
| 1057 | authDeviceIDRust, |
| 1058 | authAccessTokenRust, |
| 1059 | userIDsRust, |
| 1060 | currentID); |
| 1061 | } catch (const std::exception &e) { |
| 1062 | error = e.what(); |
| 1063 | }; |
| 1064 | if (!error.empty()) { |
| 1065 | this->jsInvoker_->invokeAsync( |
| 1066 | [error, promise]() { promise->reject(error); }); |
| 1067 | } |
| 1068 | }); |
| 1069 | } |
| 1070 | |
| 1071 | } // namespace comm |
nothing calls this directly
no test coverage detected