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

Method logOutSecondaryDevice

native/cpp/CommonCpp/NativeModules/CommRustModule.cpp:481–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481jsi::Value CommRustModule::logOutSecondaryDevice(
482 jsi::Runtime &rt,
483 jsi::String userID,
484 jsi::String deviceID,
485 jsi::String accessToken) {
486 auto userIDRust = jsiStringToRustString(userID, rt);
487 auto deviceIDRust = jsiStringToRustString(deviceID, rt);
488 auto accessTokenRust = jsiStringToRustString(accessToken, rt);
489
490 return createPromiseAsJSIValue(
491 rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
492 std::string error;
493 try {
494 auto currentID = RustPromiseManager::instance.addPromise(
495 {promise, this->jsInvoker_, innerRt});
496 identityLogOutSecondaryDevice(
497 userIDRust, deviceIDRust, accessTokenRust, currentID);
498 } catch (const std::exception &e) {
499 error = e.what();
500 };
501 if (!error.empty()) {
502 this->jsInvoker_->invokeAsync(
503 [error, promise]() { promise->reject(error); });
504 }
505 });
506}
507
508jsi::Value CommRustModule::getOutboundKeysForUser(
509 jsi::Runtime &rt,

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected