diff --git a/native/android/app/CMakeLists.txt b/native/android/app/CMakeLists.txt --- a/native/android/app/CMakeLists.txt +++ b/native/android/app/CMakeLists.txt @@ -72,6 +72,8 @@ # comm native mutual code ../../cpp/CommonCpp/NativeModules ../../cpp/CommonCpp/NativeModules/InternalModules + ../../cpp/CommonCpp/NativeModules/MessageOperationsUtilities + ../../cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageSpecs ../../cpp/CommonCpp/DatabaseManagers ../../cpp/CommonCpp/Tools ../../cpp/CommonCpp/grpc/_generated @@ -121,7 +123,10 @@ ./build/third-party-ndk/folly/folly/String.cpp ./build/third-party-ndk/folly/folly/portability/SysUio.cpp ./build/third-party-ndk/folly/folly/net/NetOps.cpp - + ./build/third-party-ndk/folly/folly/dynamic.cpp + ./build/third-party-ndk/folly/folly/json.cpp + ./build/third-party-ndk/folly/folly/json_pointer.cpp + ./build/third-party-ndk/folly/folly/Unicode.cpp # double-conversion ${DOUBLE_CONVERSION_SOURCES} diff --git a/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.h b/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.h new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/NativeModules/MessageOperationsUtilities/MessageOperationsUtilities.h @@ -0,0 +1,27 @@ +#pragma once + +#include "../../DatabaseManagers/DatabaseManager.h" +#include "../../DatabaseManagers/entities/Media.h" +#include "../../DatabaseManagers/entities/Message.h" + +#include +#include +#include + +namespace comm { +typedef std::pair> ClientDBMessageInfo; +class MessageOperationsUtilities { +private: + static ClientDBMessageInfo translateRawMessageInfoToClientDBMessageInfo( + const folly::dynamic &rawMessageInfo); + static Media translateMediaToClientDBMediaInfo( + const folly::dynamic &rawMediaInfo, + const std::string &container, + const std::string &thread); + +public: + static std::vector + translateStringToClientDBMessageInfos(std::string rawMessageInfoString); + static void storeNotification(std::string rawMessageInfoString); +}; +} // namespace comm