diff --git a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h index 0c799a117..f9e072cab 100644 --- a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h +++ b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h @@ -1,215 +1,216 @@ #pragma once #include "../CryptoTools/Persist.h" #include "entities/AuxUserInfo.h" #include "entities/CommunityInfo.h" #include "entities/Draft.h" #include "entities/EntryInfo.h" #include "entities/InboundP2PMessage.h" #include "entities/IntegrityThreadHash.h" #include "entities/KeyserverInfo.h" #include "entities/LocalMessageInfo.h" #include "entities/Media.h" #include "entities/Message.h" #include "entities/MessageStoreThread.h" #include "entities/OlmPersistAccount.h" #include "entities/OlmPersistSession.h" #include "entities/OutboundP2PMessage.h" #include "entities/PersistItem.h" #include "entities/Report.h" #include "entities/SyncedMetadataEntry.h" #include "entities/Thread.h" #include "entities/ThreadActivityEntry.h" #include "entities/UserInfo.h" #include namespace comm { /** * if any initialization/cleaning up steps are required for specific * database managers they should appear in constructors/destructors * following the RAII pattern */ class DatabaseQueryExecutor { public: virtual std::string getDraft(std::string key) const = 0; virtual std::unique_ptr getThread(std::string threadID) const = 0; virtual void updateDraft(std::string key, std::string text) const = 0; virtual bool moveDraft(std::string oldKey, std::string newKey) const = 0; virtual std::vector getAllDrafts() const = 0; virtual void removeAllDrafts() const = 0; virtual void removeDrafts(const std::vector &ids) const = 0; virtual void removeAllMessages() const = 0; virtual std::vector getInitialMessages() const = 0; virtual std::vector fetchMessages(std::string threadID, int limit, int offset) const = 0; virtual void removeMessages(const std::vector &ids) const = 0; virtual void removeMessagesForThreads(const std::vector &threadIDs) const = 0; virtual void replaceMessage(const Message &message) const = 0; virtual void rekeyMessage(std::string from, std::string to) const = 0; virtual void removeAllMedia() const = 0; virtual void replaceMessageStoreThreads( const std::vector &threads) const = 0; virtual void removeMessageStoreThreads(const std::vector &ids) const = 0; virtual void removeAllMessageStoreThreads() const = 0; virtual std::vector getAllMessageStoreThreads() const = 0; virtual void removeMediaForMessages(const std::vector &msgIDs) const = 0; virtual void removeMediaForMessage(std::string msgID) const = 0; virtual void removeMediaForThreads(const std::vector &threadIDs) const = 0; virtual void replaceMedia(const Media &media) const = 0; virtual void rekeyMediaContainers(std::string from, std::string to) const = 0; virtual std::vector getAllThreads() const = 0; virtual void removeThreads(std::vector ids) const = 0; virtual void replaceThread(const Thread &thread) const = 0; virtual void removeAllThreads() const = 0; virtual void replaceReport(const Report &report) const = 0; virtual void removeReports(const std::vector &ids) const = 0; virtual void removeAllReports() const = 0; virtual std::vector getAllReports() const = 0; virtual void setPersistStorageItem(std::string key, std::string item) const = 0; virtual void removePersistStorageItem(std::string key) const = 0; virtual std::string getPersistStorageItem(std::string key) const = 0; virtual void replaceUser(const UserInfo &userInfo) const = 0; virtual void removeUsers(const std::vector &ids) const = 0; virtual void removeAllUsers() const = 0; virtual std::vector getAllUsers() const = 0; virtual void replaceKeyserver(const KeyserverInfo &keyserverInfo) const = 0; virtual void removeKeyservers(const std::vector &ids) const = 0; virtual void removeAllKeyservers() const = 0; virtual std::vector getAllKeyservers() const = 0; virtual void replaceCommunity(const CommunityInfo &communityInfo) const = 0; virtual void removeCommunities(const std::vector &ids) const = 0; virtual void removeAllCommunities() const = 0; virtual std::vector getAllCommunities() const = 0; virtual void replaceIntegrityThreadHashes( const std::vector &threadHashes) const = 0; virtual void removeIntegrityThreadHashes(const std::vector &ids) const = 0; virtual void removeAllIntegrityThreadHashes() const = 0; virtual std::vector getAllIntegrityThreadHashes() const = 0; virtual void replaceSyncedMetadataEntry( const SyncedMetadataEntry &syncedMetadataEntry) const = 0; virtual void removeSyncedMetadata(const std::vector &names) const = 0; virtual void removeAllSyncedMetadata() const = 0; virtual std::vector getAllSyncedMetadata() const = 0; virtual void replaceAuxUserInfo(const AuxUserInfo &userInfo) const = 0; virtual void removeAuxUserInfos(const std::vector &ids) const = 0; virtual void removeAllAuxUserInfos() const = 0; virtual std::vector getAllAuxUserInfos() const = 0; virtual void replaceThreadActivityEntry( const ThreadActivityEntry &threadActivityEntry) const = 0; virtual void removeThreadActivityEntries(const std::vector &ids) const = 0; virtual void removeAllThreadActivityEntries() const = 0; virtual std::vector getAllThreadActivityEntries() const = 0; virtual void replaceEntry(const EntryInfo &entryInfo) const = 0; virtual void removeEntries(const std::vector &ids) const = 0; virtual void removeAllEntries() const = 0; virtual std::vector getAllEntries() const = 0; virtual void replaceMessageStoreLocalMessageInfo( const LocalMessageInfo &localMessageInfo) const = 0; virtual void removeMessageStoreLocalMessageInfos( const std::vector &ids) const = 0; virtual void removeAllMessageStoreLocalMessageInfos() const = 0; virtual std::vector getAllMessageStoreLocalMessageInfos() const = 0; virtual void beginTransaction() const = 0; virtual void commitTransaction() const = 0; virtual void rollbackTransaction() const = 0; virtual int getContentAccountID() const = 0; virtual int getNotifsAccountID() const = 0; virtual std::vector getOlmPersistSessionsData() const = 0; virtual std::optional getOlmPersistAccountData(int accountID) const = 0; virtual void storeOlmPersistSession(const OlmPersistSession &session) const = 0; virtual void storeOlmPersistAccount( int accountID, const std::string &accountData) const = 0; virtual void storeOlmPersistData(int accountID, crypto::Persist persist) const = 0; virtual void setNotifyToken(std::string token) const = 0; virtual void clearNotifyToken() const = 0; virtual void stampSQLiteDBUserID(std::string userID) const = 0; virtual std::string getSQLiteStampedUserID() const = 0; virtual void setMetadata(std::string entryName, std::string data) const = 0; virtual void clearMetadata(std::string entryName) const = 0; virtual std::string getMetadata(std::string entryName) const = 0; virtual void restoreFromMainCompaction( std::string mainCompactionPath, std::string mainCompactionEncryptionKey, std::string maxVersion) const = 0; virtual void restoreFromBackupLog(const std::vector &backupLog) const = 0; virtual void addOutboundP2PMessages( const std::vector &messages) const = 0; virtual std::vector getOutboundP2PMessagesByID(const std::vector &ids) const = 0; virtual std::vector getUnsentOutboundP2PMessages() const = 0; virtual void removeOutboundP2PMessage( std::string confirmedMessageID, std::string deviceID) const = 0; virtual void removeAllOutboundP2PMessages(const std::string &deviceID) const = 0; virtual void setCiphertextForOutboundP2PMessage( std::string messageID, std::string deviceID, std::string ciphertext) const = 0; virtual void markOutboundP2PMessageAsSent( std::string messageID, std::string deviceID) const = 0; virtual std::vector resetOutboundP2PMessagesForDevice(std::string deviceID) const = 0; virtual void addInboundP2PMessage(InboundP2PMessage message) const = 0; virtual std::vector getAllInboundP2PMessage() const = 0; virtual void removeInboundP2PMessages(const std::vector &ids) const = 0; virtual std::vector getInboundP2PMessagesByID(const std::vector &ids) const = 0; virtual std::vector getRelatedMessages(const std::string &messageID) const = 0; virtual void updateMessageSearchIndex( std::string originalMessageID, std::string messageID, std::string processedContent) const = 0; virtual std::vector searchMessages( std::string query, std::string threadID, std::optional timestampCursor, std::optional messageIDCursor) const = 0; virtual std::vector getRelatedMessagesForSearch( const std::vector &messageIDs) const = 0; + virtual ~DatabaseQueryExecutor() = default; #ifdef EMSCRIPTEN virtual std::vector getAllThreadsWeb() const = 0; virtual void replaceThreadWeb(const WebThread &thread) const = 0; virtual std::vector getInitialMessagesWeb() const = 0; virtual std::vector fetchMessagesWeb(std::string threadID, int limit, int offset) const = 0; virtual void replaceMessageWeb(const WebMessage &message) const = 0; virtual NullableString getOlmPersistAccountDataWeb(int accountID) const = 0; virtual std::vector getRelatedMessagesWeb(const std::string &messageID) const = 0; virtual std::vector searchMessagesWeb( std::string query, std::string threadID, std::optional timestampCursor, std::optional messageIDCursor) const = 0; #else virtual void createMainCompaction(std::string backupID) const = 0; virtual void captureBackupLogs() const = 0; #endif }; } // namespace comm diff --git a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs/MessageSpec.h b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs/MessageSpec.h index 5b672900f..c4cf41164 100644 --- a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs/MessageSpec.h +++ b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs/MessageSpec.h @@ -1,15 +1,17 @@ #pragma once #include #include #include #include #include namespace comm { class MessageSpec { public: virtual std::unique_ptr messageContentForClientDB(const folly::dynamic &rawMessageInfo) = 0; + virtual ~MessageSpec() { + } }; } // namespace comm diff --git a/web/shared-worker/_generated/comm_query_executor.wasm b/web/shared-worker/_generated/comm_query_executor.wasm index 858fb2f98..3ec3623e1 100755 Binary files a/web/shared-worker/_generated/comm_query_executor.wasm and b/web/shared-worker/_generated/comm_query_executor.wasm differ