Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33144088
D8487.1768507233.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D8487.1768507233.diff
View Options
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
@@ -70,7 +70,7 @@
virtual void commitTransaction() const = 0;
virtual void rollbackTransaction() const = 0;
virtual std::vector<OlmPersistSession> getOlmPersistSessionsData() const = 0;
- virtual folly::Optional<std::string> getOlmPersistAccountData() const = 0;
+ virtual std::optional<std::string> getOlmPersistAccountData() const = 0;
virtual void storeOlmPersistData(crypto::Persist persist) const = 0;
virtual void setNotifyToken(std::string token) const = 0;
virtual void clearNotifyToken() const = 0;
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
@@ -67,7 +67,7 @@
void commitTransaction() const override;
void rollbackTransaction() const override;
std::vector<OlmPersistSession> getOlmPersistSessionsData() const override;
- folly::Optional<std::string> getOlmPersistAccountData() const override;
+ std::optional<std::string> getOlmPersistAccountData() const override;
void storeOlmPersistData(crypto::Persist persist) const override;
void setNotifyToken(std::string token) const override;
void clearNotifyToken() const override;
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
@@ -1176,7 +1176,7 @@
return SQLiteQueryExecutor::getStorage().get_all<OlmPersistSession>();
}
-folly::Optional<std::string>
+std::optional<std::string>
SQLiteQueryExecutor::getOlmPersistAccountData() const {
std::vector<OlmPersistAccount> result =
SQLiteQueryExecutor::getStorage().get_all<OlmPersistAccount>();
@@ -1187,8 +1187,8 @@
"Multiple records found for the olm_persist_account table");
}
return (result.size() == 0)
- ? folly::none
- : folly::Optional<std::string>(result[0].account_data);
+ ? std::nullopt
+ : std::optional<std::string>(result[0].account_data);
}
void SQLiteQueryExecutor::storeOlmPersistData(crypto::Persist persist) const {
diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
@@ -938,9 +938,9 @@
crypto::Persist persist;
std::string error;
try {
- folly::Optional<std::string> accountData =
+ std::optional<std::string> accountData =
DatabaseManager::getQueryExecutor().getOlmPersistAccountData();
- if (accountData.hasValue()) {
+ if (accountData.has_value()) {
persist.account =
crypto::OlmBuffer(accountData->begin(), accountData->end());
// handle sessions data
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 15, 8:00 PM (7 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5939787
Default Alt Text
D8487.1768507233.diff (3 KB)
Attached To
Mode
D8487: [native] replace `folly::Optional` with `std::optional`
Attached
Detach File
Event Timeline
Log In to Comment