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

Method getInboundKeysForUser

native/cpp/CommonCpp/NativeModules/CommRustModule.cpp:544–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542}
543
544jsi::Value CommRustModule::getInboundKeysForUser(
545 jsi::Runtime &rt,
546 jsi::String authUserID,
547 jsi::String authDeviceID,
548 jsi::String authAccessToken,
549 jsi::String userID,
550 jsi::Array selectedDeviceIDs) {
551 auto authUserIDRust = jsiStringToRustString(authUserID, rt);
552 auto authDeviceIDRust = jsiStringToRustString(authDeviceID, rt);
553 auto authAccessTokenRust = jsiStringToRustString(authAccessToken, rt);
554 auto userIDRust = jsiStringToRustString(userID, rt);
555 auto selectedDeviceIDsRust = jsiStringArrayToRustVec(selectedDeviceIDs, rt);
556
557 return createPromiseAsJSIValue(
558 rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
559 std::string error;
560 try {
561 auto currentID = RustPromiseManager::instance.addPromise(
562 {promise, this->jsInvoker_, innerRt});
563 identityGetInboundKeysForUser(
564 authUserIDRust,
565 authDeviceIDRust,
566 authAccessTokenRust,
567 userIDRust,
568 selectedDeviceIDsRust,
569 currentID);
570 } catch (const std::exception &e) {
571 error = e.what();
572 };
573 if (!error.empty()) {
574 this->jsInvoker_->invokeAsync(
575 [error, promise]() { promise->reject(error); });
576 }
577 });
578}
579
580jsi::Value CommRustModule::versionSupported(jsi::Runtime &rt) {
581 return createPromiseAsJSIValue(

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