Page MenuHomePhabricator

D12794.diff
No OneTemporary

D12794.diff

diff --git a/native/cpp/CommonCpp/NativeModules/MessageSearchStoreOperations.h b/native/cpp/CommonCpp/NativeModules/MessageSearchStoreOperations.h
new file mode 100644
--- /dev/null
+++ b/native/cpp/CommonCpp/NativeModules/MessageSearchStoreOperations.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "DBOperationBase.h"
+#include "DatabaseManager.h"
+#include <jsi/jsi.h>
+
+namespace comm {
+
+namespace jsi = facebook::jsi;
+
+class UpdateMessageSearchIndexOperation : public DBOperationBase {
+public:
+ UpdateMessageSearchIndexOperation(
+ jsi::Runtime &rt,
+ const jsi::Object &payload)
+ : originalMessageID{payload.getProperty(rt, "originalMessageID")
+ .asString(rt)
+ .utf8(rt)},
+ messageID{payload.getProperty(rt, "messageID").asString(rt).utf8(rt)},
+ content{payload.getProperty(rt, "content").asString(rt).utf8(rt)} {
+ }
+
+ virtual void execute() override {
+ DatabaseManager::getQueryExecutor().updateMessageSearchIndex(
+ this->originalMessageID, this->messageID, this->content);
+ }
+
+private:
+ std::string originalMessageID;
+ std::string messageID;
+ std::string content;
+};
+
+} // namespace comm

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 11:21 PM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577601
Default Alt Text
D12794.diff (1 KB)

Event Timeline