From 361339d01bc95ad397aea48fff0b5cc523307236 Mon Sep 17 00:00:00 2001 From: Kateryna Kostiuk Date: Fri, 23 Aug 2024 11:47:28 -0400 Subject: [PATCH] connection request: fix conversation id parsing Change-Id: I7ffd3f5785f22654fc99eb3e5c2e94f6b3f01293 --- src/jamidht/jamiaccount.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index b984c07c845..e17e17edaf7 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -3078,7 +3078,8 @@ 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; @@ -3086,7 +3087,7 @@ JamiAccount::sendMessage(const std::string& to, 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(); }