Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32455915
D3984.1765368075.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3984.1765368075.diff
View Options
diff --git a/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.cpp b/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.cpp
--- a/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.cpp
+++ b/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.cpp
@@ -72,4 +72,25 @@
std::move(type),
std::move(extras)};
}
+
+std::vector<std::pair<Message, std::vector<Media>>>
+MessageOperationsUtilities::translateStringToClientDBMessageInfo(
+ std::string rawMessageInfoString) {
+ folly::dynamic rawMessageInfos =
+ folly::parseJson(folly::trimWhitespace(rawMessageInfoString));
+ if (!rawMessageInfos.isArray()) {
+ throw std::runtime_error(
+ "messageInfos is expected to be an array of JSON objects");
+ }
+ std::vector<std::pair<Message, std::vector<Media>>> clientDBMessageInfos;
+ for (const auto &messageInfo : rawMessageInfos) {
+ if (!messageInfo.isObject()) {
+ throw std::runtime_error(
+ "encountered messageInfos element that is not JSON object");
+ }
+ clientDBMessageInfos.push_back(
+ translateRawMessageInfoToClientDBMessageInfo(messageInfo));
+ }
+ return clientDBMessageInfos;
+}
} // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 10, 12:01 PM (19 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5863634
Default Alt Text
D3984.1765368075.diff (1 KB)
Attached To
Mode
D3984: Implement translation of raw string from notification into SQLite database entities.
Attached
Detach File
Event Timeline
Log In to Comment