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

Method getDeviceListsForUsers

native/cpp/CommonCpp/NativeModules/CommRustModule.cpp:705–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703}
704
705jsi::Value CommRustModule::getDeviceListsForUsers(
706 jsi::Runtime &rt,
707 jsi::String authUserID,
708 jsi::String authDeviceID,
709 jsi::String authAccessToken,
710 jsi::Array userIDs) {
711 auto authUserIDRust = jsiStringToRustString(authUserID, rt);
712 auto authDeviceIDRust = jsiStringToRustString(authDeviceID, rt);
713 auto authAccessTokenRust = jsiStringToRustString(authAccessToken, rt);
714 auto userIDsRust = jsiStringArrayToRustVec(userIDs, rt);
715
716 return createPromiseAsJSIValue(
717 rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
718 std::string error;
719 try {
720 auto currentID = RustPromiseManager::instance.addPromise(
721 {promise, this->jsInvoker_, innerRt});
722 identityGetDeviceListsForUsers(
723 authUserIDRust,
724 authDeviceIDRust,
725 authAccessTokenRust,
726 userIDsRust,
727 currentID);
728 } catch (const std::exception &e) {
729 error = e.what();
730 };
731 if (!error.empty()) {
732 this->jsInvoker_->invokeAsync(
733 [error, promise]() { promise->reject(error); });
734 }
735 });
736}
737
738jsi::Value CommRustModule::updateDeviceList(
739 jsi::Runtime &rt,

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