Page MenuHomePhabricator

D12855.diff
No OneTemporary

D12855.diff

diff --git a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
@@ -55,10 +55,10 @@
virtual void removeAllMessageStoreThreads() const = 0;
virtual std::vector<MessageStoreThread> getAllMessageStoreThreads() const = 0;
virtual void
- removeMediaForMessages(const std::vector<std::string> &msg_ids) const = 0;
- virtual void removeMediaForMessage(std::string msg_id) const = 0;
+ removeMediaForMessages(const std::vector<std::string> &msgIDs) const = 0;
+ virtual void removeMediaForMessage(std::string msgID) const = 0;
virtual void
- removeMediaForThreads(const std::vector<std::string> &thread_ids) const = 0;
+ removeMediaForThreads(const std::vector<std::string> &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<Thread> getAllThreads() const = 0;
@@ -73,49 +73,49 @@
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 &user_info) const = 0;
+ virtual void replaceUser(const UserInfo &userInfo) const = 0;
virtual void removeUsers(const std::vector<std::string> &ids) const = 0;
virtual void removeAllUsers() const = 0;
virtual std::vector<UserInfo> getAllUsers() const = 0;
- virtual void replaceKeyserver(const KeyserverInfo &keyserver_info) const = 0;
+ virtual void replaceKeyserver(const KeyserverInfo &keyserverInfo) const = 0;
virtual void removeKeyservers(const std::vector<std::string> &ids) const = 0;
virtual void removeAllKeyservers() const = 0;
virtual std::vector<KeyserverInfo> getAllKeyservers() const = 0;
- virtual void replaceCommunity(const CommunityInfo &community_info) const = 0;
+ virtual void replaceCommunity(const CommunityInfo &communityInfo) const = 0;
virtual void removeCommunities(const std::vector<std::string> &ids) const = 0;
virtual void removeAllCommunities() const = 0;
virtual std::vector<CommunityInfo> getAllCommunities() const = 0;
virtual void replaceIntegrityThreadHashes(
- const std::vector<IntegrityThreadHash> &thread_hashes) const = 0;
+ const std::vector<IntegrityThreadHash> &threadHashes) const = 0;
virtual void
removeIntegrityThreadHashes(const std::vector<std::string> &ids) const = 0;
virtual void removeAllIntegrityThreadHashes() const = 0;
virtual std::vector<IntegrityThreadHash>
getAllIntegrityThreadHashes() const = 0;
virtual void replaceSyncedMetadataEntry(
- const SyncedMetadataEntry &synced_metadata_entry) const = 0;
+ const SyncedMetadataEntry &syncedMetadataEntry) const = 0;
virtual void
removeSyncedMetadata(const std::vector<std::string> &names) const = 0;
virtual void removeAllSyncedMetadata() const = 0;
virtual std::vector<SyncedMetadataEntry> getAllSyncedMetadata() const = 0;
- virtual void replaceAuxUserInfo(const AuxUserInfo &aux_user_info) const = 0;
+ virtual void replaceAuxUserInfo(const AuxUserInfo &userInfo) const = 0;
virtual void
removeAuxUserInfos(const std::vector<std::string> &ids) const = 0;
virtual void removeAllAuxUserInfos() const = 0;
virtual std::vector<AuxUserInfo> getAllAuxUserInfos() const = 0;
virtual void replaceThreadActivityEntry(
- const ThreadActivityEntry &thread_activity_entry) const = 0;
+ const ThreadActivityEntry &threadActivityEntry) const = 0;
virtual void
removeThreadActivityEntries(const std::vector<std::string> &ids) const = 0;
virtual void removeAllThreadActivityEntries() const = 0;
virtual std::vector<ThreadActivityEntry>
getAllThreadActivityEntries() const = 0;
- virtual void replaceEntry(const EntryInfo &entry_info) const = 0;
+ virtual void replaceEntry(const EntryInfo &entryInfo) const = 0;
virtual void removeEntries(const std::vector<std::string> &ids) const = 0;
virtual void removeAllEntries() const = 0;
virtual std::vector<EntryInfo> getAllEntries() const = 0;
virtual void replaceMessageStoreLocalMessageInfo(
- const LocalMessageInfo &local_message_info) const = 0;
+ const LocalMessageInfo &localMessageInfo) const = 0;
virtual void removeMessageStoreLocalMessageInfos(
const std::vector<std::string> &ids) const = 0;
virtual void removeAllMessageStoreLocalMessageInfos() const = 0;
@@ -140,9 +140,9 @@
virtual void clearNotifyToken() const = 0;
virtual void stampSQLiteDBUserID(std::string userID) const = 0;
virtual std::string getSQLiteStampedUserID() const = 0;
- virtual void setMetadata(std::string entry_name, std::string data) const = 0;
- virtual void clearMetadata(std::string entry_name) const = 0;
- virtual std::string getMetadata(std::string entry_name) 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,
@@ -173,9 +173,9 @@
virtual std::vector<MessageEntity>
getRelatedMessages(const std::string &messageID) const = 0;
virtual void updateMessageSearchIndex(
- std::string original_message_id,
- std::string message_id,
- std::string processed_content) const = 0;
+ std::string originalMessageID,
+ std::string messageID,
+ std::string processedContent) const = 0;
virtual std::vector<MessageEntity> searchMessages(
std::string query,
std::string threadID,
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
@@ -75,11 +75,11 @@
void removeAllMessageStoreThreads() const override;
std::vector<MessageStoreThread> getAllMessageStoreThreads() const override;
void removeAllMedia() const override;
- void removeMediaForMessages(
- const std::vector<std::string> &msg_ids) const override;
- void removeMediaForMessage(std::string msg_id) const override;
+ void
+ removeMediaForMessages(const std::vector<std::string> &msgIDs) const override;
+ void removeMediaForMessage(std::string msgID) const override;
void removeMediaForThreads(
- const std::vector<std::string> &thread_ids) const override;
+ const std::vector<std::string> &threadIDs) const override;
void replaceMedia(const Media &media) const override;
void rekeyMediaContainers(std::string from, std::string to) const override;
std::vector<Thread> getAllThreads() const override;
@@ -93,46 +93,46 @@
void setPersistStorageItem(std::string key, std::string item) const override;
void removePersistStorageItem(std::string key) const override;
std::string getPersistStorageItem(std::string key) const override;
- void replaceUser(const UserInfo &user_info) const override;
+ void replaceUser(const UserInfo &userInfo) const override;
void removeUsers(const std::vector<std::string> &ids) const override;
void removeAllUsers() const override;
std::vector<UserInfo> getAllUsers() const override;
- void replaceKeyserver(const KeyserverInfo &keyserver_info) const override;
+ void replaceKeyserver(const KeyserverInfo &keyserverInfo) const override;
void removeKeyservers(const std::vector<std::string> &ids) const override;
void removeAllKeyservers() const override;
std::vector<KeyserverInfo> getAllKeyservers() const override;
- void replaceCommunity(const CommunityInfo &community_info) const override;
+ void replaceCommunity(const CommunityInfo &communityInfo) const override;
void removeCommunities(const std::vector<std::string> &ids) const override;
void removeAllCommunities() const override;
std::vector<CommunityInfo> getAllCommunities() const override;
void replaceIntegrityThreadHashes(
- const std::vector<IntegrityThreadHash> &thread_hashes) const override;
+ const std::vector<IntegrityThreadHash> &threadHashes) const override;
void removeIntegrityThreadHashes(
const std::vector<std::string> &ids) const override;
void removeAllIntegrityThreadHashes() const override;
std::vector<IntegrityThreadHash> getAllIntegrityThreadHashes() const override;
void replaceSyncedMetadataEntry(
- const SyncedMetadataEntry &synced_metadata_entry) const override;
+ const SyncedMetadataEntry &syncedMetadataEntry) const override;
void
removeSyncedMetadata(const std::vector<std::string> &names) const override;
void removeAllSyncedMetadata() const override;
std::vector<SyncedMetadataEntry> getAllSyncedMetadata() const override;
- void replaceAuxUserInfo(const AuxUserInfo &aux_user_info) const override;
+ void replaceAuxUserInfo(const AuxUserInfo &userInfo) const override;
void removeAuxUserInfos(const std::vector<std::string> &ids) const override;
void removeAllAuxUserInfos() const override;
virtual std::vector<AuxUserInfo> getAllAuxUserInfos() const override;
void replaceThreadActivityEntry(
- const ThreadActivityEntry &thread_activity_entry) const override;
+ const ThreadActivityEntry &threadActivityEntry) const override;
void removeThreadActivityEntries(
const std::vector<std::string> &ids) const override;
void removeAllThreadActivityEntries() const override;
std::vector<ThreadActivityEntry> getAllThreadActivityEntries() const override;
- void replaceEntry(const EntryInfo &entry_info) const override;
+ void replaceEntry(const EntryInfo &entryInfo) const override;
void removeEntries(const std::vector<std::string> &ids) const override;
void removeAllEntries() const override;
std::vector<EntryInfo> getAllEntries() const override;
void replaceMessageStoreLocalMessageInfo(
- const LocalMessageInfo &local_message_info) const override;
+ const LocalMessageInfo &localMessageInfo) const override;
void removeMessageStoreLocalMessageInfos(
const std::vector<std::string> &ids) const override;
void removeAllMessageStoreLocalMessageInfos() const override;
@@ -155,9 +155,9 @@
void clearNotifyToken() const override;
void stampSQLiteDBUserID(std::string userID) const override;
std::string getSQLiteStampedUserID() const override;
- void setMetadata(std::string entry_name, std::string data) const override;
- void clearMetadata(std::string entry_name) const override;
- std::string getMetadata(std::string entry_name) const override;
+ void setMetadata(std::string entryName, std::string data) const override;
+ void clearMetadata(std::string entryName) const override;
+ std::string getMetadata(std::string entryName) const override;
void restoreFromMainCompaction(
std::string mainCompactionPath,
std::string mainCompactionEncryptionKey,
@@ -186,9 +186,9 @@
std::vector<MessageEntity>
getRelatedMessages(const std::string &messageID) const override;
void updateMessageSearchIndex(
- std::string original_message_id,
- std::string message_id,
- std::string processed_content) const override;
+ std::string originalMessageID,
+ std::string messageID,
+ std::string processedContent) const override;
std::vector<MessageEntity> searchMessages(
std::string query,
std::string threadID,
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -1503,9 +1503,9 @@
}
void SQLiteQueryExecutor::updateMessageSearchIndex(
- std::string original_message_id,
- std::string message_id,
- std::string processed_content) const {
+ std::string originalMessageID,
+ std::string messageID,
+ std::string processedContent) const {
sqlite3 *db = SQLiteQueryExecutor::getConnection();
int bindResult = 0;
@@ -1520,24 +1520,24 @@
"SET message_id = ?, processed_content = ? "
"WHERE original_message_id = ?;";
- if (original_message_id == message_id) {
+ if (originalMessageID == messageID) {
preparedSQL = std::make_unique<SQLiteStatementWrapper>(
db,
insertMessageSearchResultSQL,
"Failed to update message search entry.");
- bindStringToSQL(original_message_id, *preparedSQL, 1);
- bindStringToSQL(message_id, *preparedSQL, 2);
- bindResult = bindStringToSQL(processed_content, *preparedSQL, 3);
+ bindStringToSQL(originalMessageID, *preparedSQL, 1);
+ bindStringToSQL(messageID, *preparedSQL, 2);
+ bindResult = bindStringToSQL(processedContent, *preparedSQL, 3);
} else {
preparedSQL = std::make_unique<SQLiteStatementWrapper>(
db,
updateMessageSearchResultSQL,
"Failed to update message search entry.");
- bindStringToSQL(message_id, *preparedSQL, 1);
- bindStringToSQL(processed_content, *preparedSQL, 2);
- bindResult = bindStringToSQL(original_message_id, *preparedSQL, 3);
+ bindStringToSQL(messageID, *preparedSQL, 1);
+ bindStringToSQL(processedContent, *preparedSQL, 2);
+ bindResult = bindStringToSQL(originalMessageID, *preparedSQL, 3);
}
if (bindResult != SQLITE_OK) {
@@ -1565,46 +1565,46 @@
}
void SQLiteQueryExecutor::removeMediaForMessages(
- const std::vector<std::string> &msg_ids) const {
- if (!msg_ids.size()) {
+ const std::vector<std::string> &msgIDs) const {
+ if (!msgIDs.size()) {
return;
}
std::stringstream removeMediaByKeysSQLStream;
removeMediaByKeysSQLStream << "DELETE FROM media "
"WHERE container IN "
- << getSQLStatementArray(msg_ids.size()) << ";";
+ << getSQLStatementArray(msgIDs.size()) << ";";
removeEntitiesByKeys(
SQLiteQueryExecutor::getConnection(),
removeMediaByKeysSQLStream.str(),
- msg_ids);
+ msgIDs);
}
-void SQLiteQueryExecutor::removeMediaForMessage(std::string msg_id) const {
+void SQLiteQueryExecutor::removeMediaForMessage(std::string msgID) const {
static std::string removeMediaByKeySQL =
"DELETE FROM media "
"WHERE container IN (?);";
- std::vector<std::string> keys = {msg_id};
+ std::vector<std::string> keys = {msgID};
removeEntitiesByKeys(
SQLiteQueryExecutor::getConnection(), removeMediaByKeySQL, keys);
}
void SQLiteQueryExecutor::removeMediaForThreads(
- const std::vector<std::string> &thread_ids) const {
- if (!thread_ids.size()) {
+ const std::vector<std::string> &threadIDs) const {
+ if (!threadIDs.size()) {
return;
}
std::stringstream removeMediaByKeysSQLStream;
removeMediaByKeysSQLStream << "DELETE FROM media "
"WHERE thread IN "
- << getSQLStatementArray(thread_ids.size()) << ";";
+ << getSQLStatementArray(threadIDs.size()) << ";";
removeEntitiesByKeys(
SQLiteQueryExecutor::getConnection(),
removeMediaByKeysSQLStream.str(),
- thread_ids);
+ threadIDs);
}
void SQLiteQueryExecutor::replaceMedia(const Media &media) const {
@@ -1791,12 +1791,12 @@
return (entry == nullptr) ? "" : entry->item;
}
-void SQLiteQueryExecutor::replaceUser(const UserInfo &user_info) const {
+void SQLiteQueryExecutor::replaceUser(const UserInfo &userInfo) const {
static std::string replaceUserSQL =
"REPLACE INTO users (id, user_info) "
"VALUES (?, ?);";
replaceEntity<UserInfo>(
- SQLiteQueryExecutor::getConnection(), replaceUserSQL, user_info);
+ SQLiteQueryExecutor::getConnection(), replaceUserSQL, userInfo);
}
void SQLiteQueryExecutor::removeAllUsers() const {
@@ -1821,14 +1821,12 @@
}
void SQLiteQueryExecutor::replaceKeyserver(
- const KeyserverInfo &keyserver_info) const {
+ const KeyserverInfo &keyserverInfo) const {
static std::string replaceKeyserverSQL =
"REPLACE INTO keyservers (id, keyserver_info) "
"VALUES (:id, :keyserver_info);";
replaceEntity<KeyserverInfo>(
- SQLiteQueryExecutor::getConnection(),
- replaceKeyserverSQL,
- keyserver_info);
+ SQLiteQueryExecutor::getConnection(), replaceKeyserverSQL, keyserverInfo);
static std::string replaceKeyserverSyncedSQL =
"REPLACE INTO keyservers_synced (id, keyserver_info) "
@@ -1836,7 +1834,7 @@
replaceEntity<KeyserverInfo>(
SQLiteQueryExecutor::getConnection(),
replaceKeyserverSyncedSQL,
- keyserver_info);
+ keyserverInfo);
}
void SQLiteQueryExecutor::removeAllKeyservers() const {
@@ -1900,14 +1898,12 @@
}
void SQLiteQueryExecutor::replaceCommunity(
- const CommunityInfo &community_info) const {
+ const CommunityInfo &communityInfo) const {
static std::string replaceCommunitySQL =
"REPLACE INTO communities (id, community_info) "
"VALUES (?, ?);";
replaceEntity<CommunityInfo>(
- SQLiteQueryExecutor::getConnection(),
- replaceCommunitySQL,
- community_info);
+ SQLiteQueryExecutor::getConnection(), replaceCommunitySQL, communityInfo);
}
void SQLiteQueryExecutor::removeAllCommunities() const {
@@ -1989,14 +1985,14 @@
}
void SQLiteQueryExecutor::replaceSyncedMetadataEntry(
- const SyncedMetadataEntry &synced_metadata_entry) const {
+ const SyncedMetadataEntry &syncedMetadataEntry) const {
static std::string replaceSyncedMetadataEntrySQL =
"REPLACE INTO synced_metadata (name, data) "
"VALUES (?, ?);";
replaceEntity<SyncedMetadataEntry>(
SQLiteQueryExecutor::getConnection(),
replaceSyncedMetadataEntrySQL,
- synced_metadata_entry);
+ syncedMetadataEntry);
}
void SQLiteQueryExecutor::removeAllSyncedMetadata() const {
@@ -2048,14 +2044,12 @@
}
void SQLiteQueryExecutor::replaceAuxUserInfo(
- const AuxUserInfo &aux_user_info) const {
+ const AuxUserInfo &userInfo) const {
static std::string replaceAuxUserInfoSQL =
"REPLACE INTO aux_users (id, aux_user_info) "
"VALUES (?, ?);";
replaceEntity<AuxUserInfo>(
- SQLiteQueryExecutor::getConnection(),
- replaceAuxUserInfoSQL,
- aux_user_info);
+ SQLiteQueryExecutor::getConnection(), replaceAuxUserInfoSQL, userInfo);
}
void SQLiteQueryExecutor::removeAllAuxUserInfos() const {
@@ -2090,14 +2084,14 @@
}
void SQLiteQueryExecutor::replaceThreadActivityEntry(
- const ThreadActivityEntry &thread_activity_entry) const {
+ const ThreadActivityEntry &threadActivityEntry) const {
static std::string replaceThreadActivityEntrySQL =
"REPLACE INTO thread_activity (id, thread_activity_store_entry) "
"VALUES (?, ?);";
replaceEntity<ThreadActivityEntry>(
SQLiteQueryExecutor::getConnection(),
replaceThreadActivityEntrySQL,
- thread_activity_entry);
+ threadActivityEntry);
}
void SQLiteQueryExecutor::removeAllThreadActivityEntries() const {
@@ -2134,12 +2128,12 @@
SQLiteQueryExecutor::getConnection(), getAllThreadActivityEntriesSQL);
}
-void SQLiteQueryExecutor::replaceEntry(const EntryInfo &entry_info) const {
+void SQLiteQueryExecutor::replaceEntry(const EntryInfo &entryInfo) const {
static std::string replaceEntrySQL =
"REPLACE INTO entries (id, entry) "
"VALUES (?, ?);";
replaceEntity<EntryInfo>(
- SQLiteQueryExecutor::getConnection(), replaceEntrySQL, entry_info);
+ SQLiteQueryExecutor::getConnection(), replaceEntrySQL, entryInfo);
}
void SQLiteQueryExecutor::removeAllEntries() const {
@@ -2172,14 +2166,14 @@
}
void SQLiteQueryExecutor::replaceMessageStoreLocalMessageInfo(
- const LocalMessageInfo &local_message_info) const {
+ const LocalMessageInfo &localMessageInfo) const {
static std::string replaceLocalMessageInfoSQL =
"REPLACE INTO message_store_local (id, local_message_info) "
"VALUES (?, ?);";
replaceEntity<LocalMessageInfo>(
SQLiteQueryExecutor::getConnection(),
replaceLocalMessageInfoSQL,
- local_message_info);
+ localMessageInfo);
}
void SQLiteQueryExecutor::removeMessageStoreLocalMessageInfos(
@@ -2330,29 +2324,29 @@
return this->getMetadata("current_user_id");
}
-void SQLiteQueryExecutor::setMetadata(std::string entry_name, std::string data)
+void SQLiteQueryExecutor::setMetadata(std::string entryName, std::string data)
const {
std::string replaceMetadataSQL =
"REPLACE INTO metadata (name, data) "
"VALUES (?, ?);";
Metadata entry{
- entry_name,
+ entryName,
data,
};
replaceEntity<Metadata>(
SQLiteQueryExecutor::getConnection(), replaceMetadataSQL, entry);
}
-void SQLiteQueryExecutor::clearMetadata(std::string entry_name) const {
+void SQLiteQueryExecutor::clearMetadata(std::string entryName) const {
static std::string removeMetadataByKeySQL =
"DELETE FROM metadata "
"WHERE name IN (?);";
- std::vector<std::string> keys = {entry_name};
+ std::vector<std::string> keys = {entryName};
removeEntitiesByKeys(
SQLiteQueryExecutor::getConnection(), removeMetadataByKeySQL, keys);
}
-std::string SQLiteQueryExecutor::getMetadata(std::string entry_name) const {
+std::string SQLiteQueryExecutor::getMetadata(std::string entryName) const {
std::string getMetadataByPrimaryKeySQL =
"SELECT * "
"FROM metadata "
@@ -2360,7 +2354,7 @@
std::unique_ptr<Metadata> entry = getEntityByPrimaryKey<Metadata>(
SQLiteQueryExecutor::getConnection(),
getMetadataByPrimaryKeySQL,
- entry_name);
+ entryName);
return (entry == nullptr) ? "" : entry->data;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 1:16 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577902
Default Alt Text
D12855.diff (21 KB)

Event Timeline