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

Method getClientDBStore

native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp:55–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55jsi::Value CommCoreModule::getClientDBStore(
56 jsi::Runtime &rt,
57 std::optional<jsi::String> dbID) {
58 DatabaseIdentifier identifier = DatabaseIdentifier::MAIN;
59 if (dbID.has_value()) {
60 identifier = stringToDatabaseIdentifier(dbID->utf8(rt));
61 }
62
63 return createPromiseAsJSIValue(
64 rt, [=](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
65 taskType job = [=, &innerRt]() {
66 std::string error;
67 std::vector<Draft> draftsVector;
68 std::vector<Thread> threadsVector;
69 std::vector<MessageEntity> messagesVector;
70 std::vector<MessageStoreThread> messageStoreThreadsVector;
71 std::vector<Report> reportStoreVector;
72 std::vector<UserInfo> userStoreVector;
73 std::vector<KeyserverInfo> keyserverStoreVector;
74 std::vector<CommunityInfo> communityStoreVector;
75 std::vector<IntegrityThreadHash> integrityStoreVector;
76 std::vector<SyncedMetadataEntry> syncedMetadataStoreVector;
77 std::vector<AuxUserInfo> auxUserStoreVector;
78 std::vector<ThreadActivityEntry> threadActivityStoreVector;
79 std::vector<EntryInfo> entryStoreVector;
80 std::vector<LocalMessageInfo> messageStoreLocalMessageInfosVector;
81 std::vector<DMOperation> dmOperationsVector;
82 std::vector<Holder> holdersVector;
83 std::vector<QueuedDMOperation> queuedDMOperationsVector;
84 try {
85 draftsVector =
86 DatabaseManager::getQueryExecutor(identifier).getAllDrafts();
87 messagesVector = DatabaseManager::getQueryExecutor(identifier)
88 .getInitialMessages();
89 threadsVector =
90 DatabaseManager::getQueryExecutor(identifier).getAllThreads();
91 messageStoreThreadsVector =
92 DatabaseManager::getQueryExecutor(identifier)
93 .getAllMessageStoreThreads();
94 reportStoreVector =
95 DatabaseManager::getQueryExecutor(identifier).getAllReports();
96 userStoreVector =
97 DatabaseManager::getQueryExecutor(identifier).getAllUsers();
98 keyserverStoreVector = DatabaseManager::getQueryExecutor(identifier)
99 .getAllKeyservers();
100 communityStoreVector = DatabaseManager::getQueryExecutor(identifier)
101 .getAllCommunities();
102 integrityStoreVector = DatabaseManager::getQueryExecutor(identifier)
103 .getAllIntegrityThreadHashes();
104 syncedMetadataStoreVector =
105 DatabaseManager::getQueryExecutor(identifier)
106 .getAllSyncedMetadata();
107 auxUserStoreVector = DatabaseManager::getQueryExecutor(identifier)
108 .getAllAuxUserInfos();
109 threadActivityStoreVector =
110 DatabaseManager::getQueryExecutor(identifier)
111 .getAllThreadActivityEntries();
112 entryStoreVector =

Callers

nothing calls this directly

Calls 15

getDMOperationsMethod · 0.80
rejectMethod · 0.80
resolveMethod · 0.80
getAllDraftsMethod · 0.45
getInitialMessagesMethod · 0.45
getAllThreadsMethod · 0.45

Tested by

no test coverage detected