Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3524225
D6964.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6964.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6964: [native] Added new editing messages type to MessageSpecs in C++
Attached
Detach File
Event Timeline
Log In to Comment