Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3384965
D11312.id38031.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
D11312.id38031.diff
View Options
diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
@@ -583,6 +583,20 @@
return jsiOneTimeKeys;
}
+jsi::String parseOLMPrekey(jsi::Runtime &rt, std::string prekeyBlob) {
+ folly::dynamic parsedPrekey = folly::parseJson(prekeyBlob);
+
+ auto prekey = parsedPrekey["curve25519"].values().begin()->asString();
+ return jsi::String::createFromUtf8(rt, prekey);
+}
+
+rust::String parseOLMPrekey(std::string prekeyBlob) {
+ folly::dynamic parsedPrekey = folly::parseJson(prekeyBlob);
+
+ auto prekey = parsedPrekey["curve25519"].values().begin()->asString();
+ return rust::String(prekey);
+}
+
jsi::Object parseOneTimeKeysResult(
jsi::Runtime &rt,
std::string contentOneTimeKeysBlob,
@@ -710,9 +724,9 @@
authUserIDRust,
authDeviceIDRust,
authAccessTokenRust,
- rust::string(prekeyToUpload),
+ parseOLMPrekey(prekeyToUpload),
rust::string(prekeySignature),
- rust::string(notificationsPrekey),
+ parseOLMPrekey(notificationsPrekey),
rust::string(notificationsPrekeySignature),
currentID);
prekeyFuture.get();
@@ -783,11 +797,10 @@
return;
}
auto contentPrekeyJSI =
- jsi::String::createFromUtf8(innerRt, contentPrekey.value());
+ parseOLMPrekey(innerRt, contentPrekey.value());
auto contentPrekeySignatureJSI =
jsi::String::createFromUtf8(innerRt, contentPrekeySignature);
- auto notifPrekeyJSI =
- jsi::String::createFromUtf8(innerRt, notifPrekey);
+ auto notifPrekeyJSI = parseOLMPrekey(innerRt, notifPrekey);
auto notifPrekeySignatureJSI =
jsi::String::createFromUtf8(innerRt, notifPrekeySignature);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 10:54 PM (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2598493
Default Alt Text
D11312.id38031.diff (2 KB)
Attached To
Mode
D11312: [native] use short form for prekeys
Attached
Detach File
Event Timeline
Log In to Comment