MCPcopy Create free account
hub / github.com/CommE2E/comm / findUserIdentities

Method findUserIdentities

native/cpp/CommonCpp/NativeModules/CommRustModule.cpp:1038–1069  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1036}
1037
1038jsi::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

Callers

nothing calls this directly

Calls 5

jsiStringToRustStringFunction · 0.85
jsiStringArrayToRustVecFunction · 0.85
addPromiseMethod · 0.80
rejectMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected