Skip to content

Commit

Permalink
connection request: fix conversation id parsing
Browse files Browse the repository at this point in the history
Change-Id: I7ffd3f5785f22654fc99eb3e5c2e94f6b3f01293
  • Loading branch information
katekm committed Aug 23, 2024
1 parent 54696df commit 361339d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/jamidht/jamiaccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3078,15 +3078,16 @@ JamiAccount::sendMessage(const std::string& to,
// We couldn't send the message directly, try connecting
messageEngine_.onMessageSent(to, token, false, deviceId);

// get conversation id
// Get conversation id, which will be used by the iOS notification extension
// to load the conversation.
auto extractIdFromJson = [](const std::string& jsonData) -> std::string {
Json::Value parsed;
Json::CharReaderBuilder readerBuilder;
auto reader = std::unique_ptr<Json::CharReader>(readerBuilder.newCharReader());
std::string errors;

if (reader->parse(jsonData.c_str(), jsonData.c_str() + jsonData.size(), &parsed, &errors)) {
auto value = parsed.get("value", Json::nullValue);
auto value = parsed.get("id", Json::nullValue);
if (value && value.isString()) {
return value.asString();
}
Expand Down

0 comments on commit 361339d

Please sign in to comment.