Page MenuHomePhabricator

D6964.diff
No OneTemporary

D6964.diff

diff --git a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs.h b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs.h
--- a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs.h
+++ b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs.h
@@ -8,6 +8,7 @@
#include "MessageSpecs/CreateThreadMessageSpec.h"
#include "MessageSpecs/DeleteEntryMessageSpec.h"
#include "MessageSpecs/EditEntryMessageSpec.h"
+#include "MessageSpecs/EditMessageSpec.h"
#include "MessageSpecs/MessageSpec.h"
#include "MessageSpecs/MultimediaMessageSpec.h"
#include "MessageSpecs/ReactionMessageSpec.h"
@@ -42,6 +43,7 @@
SIDEBAR_SOURCE,
CREATE_SIDEBAR,
REACTION,
+ EDIT_MESSAGE,
};
const std::map<MessageType, std::unique_ptr<MessageSpec>> messageSpecsHolder =
@@ -91,6 +93,8 @@
message_specs_initializer.insert(
{MessageType::SIDEBAR_SOURCE,
std::make_unique<SidebarSourceMessageSpec>()});
+ message_specs_initializer.insert(
+ {MessageType::EDIT_MESSAGE, std::make_unique<EditMessageSpec>()});
return message_specs_initializer;
}();
diff --git a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs/EditMessageSpec.h b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs/EditMessageSpec.h
new file mode 100644
--- /dev/null
+++ b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs/EditMessageSpec.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "MessageSpec.h"
+
+namespace comm {
+class EditMessageSpec : public MessageSpec {
+ virtual std::unique_ptr<std::string>
+ messageContentForClientDB(const folly::dynamic &rawMessageInfo) override {
+ folly::dynamic textData = folly::dynamic::object(
+ "targetMessageID",
+ rawMessageInfo["targetMessageID"])("text", rawMessageInfo["text"]);
+ return std::make_unique<std::string>(folly::toJson(textData));
+ }
+};
+} // namespace comm

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 11:43 AM (16 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2699893
Default Alt Text
D6964.diff (2 KB)

Event Timeline