Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3279211
D3982.id12551.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3982.id12551.diff
View Options
diff --git a/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.cpp b/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.cpp
new file mode 100644
--- /dev/null
+++ b/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.cpp
@@ -0,0 +1,24 @@
+#include "MessageOperationsUtilities.h"
+#include "MessageSpecs.h"
+
+#include <folly/String.h>
+
+namespace comm {
+Media MessageOperationsUtilities::translateMediaToClientDBMediaInfo(
+ const folly::dynamic &rawMediaInfo,
+ const std::string &container,
+ const std::string &thread) {
+ std::string id = rawMediaInfo["id"].asString();
+ std::string uri = rawMediaInfo["uri"].asString();
+ std::string type = rawMediaInfo["type"].asString();
+ folly::dynamic extrasData =
+ folly::dynamic::object("dimensions", rawMediaInfo["dimensions"])(
+ "loop", (type == "video") ? rawMediaInfo["loop"] : false);
+ if (rawMediaInfo.count("localMediaSelection")) {
+ extrasData["local_media_selection"] = rawMediaInfo["localMediaSelection"];
+ }
+ std::string extras = folly::toJson(extrasData);
+ return Media{id, container, thread, uri, type, extras};
+}
+
+} // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 8:38 AM (21 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2520406
Default Alt Text
D3982.id12551.diff (1 KB)
Attached To
Mode
D3982: Implement translation of media JSON object to SQLite database entities
Attached
Detach File
Event Timeline
Log In to Comment