Skip to content
Snippets Groups Projects
Commit 3d4330a1 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

plugins: fix id grabbing

Change-Id: I9b65b0121d228ab62abaf781c4dc11a6a9380ab4
parent ea3f484f
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ JamiPluginManager::getPluginDetails(const std::string& rootPath, bool reset) ...@@ -86,7 +86,7 @@ JamiPluginManager::getPluginDetails(const std::string& rootPath, bool reset)
itImage->second.insert(0, rootPath + DIR_SEPARATOR_CH + "data" + DIR_SEPARATOR_CH); itImage->second.insert(0, rootPath + DIR_SEPARATOR_CH + "data" + DIR_SEPARATOR_CH);
details["soPath"] = rootPath + DIR_SEPARATOR_CH + LIB_PREFIX + details["id"] + LIB_TYPE; details["soPath"] = rootPath + DIR_SEPARATOR_CH + LIB_PREFIX + details["id"] + LIB_TYPE;
details["author"] = getPluginAuthor(rootPath, details["name"]); details["author"] = getPluginAuthor(rootPath, details["id"]);
detailsIt = pluginDetailsMap_.emplace(rootPath, std::move(details)).first; detailsIt = pluginDetailsMap_.emplace(rootPath, std::move(details)).first;
return detailsIt->second; return detailsIt->second;
} }
...@@ -143,7 +143,7 @@ JamiPluginManager::checkPluginSignatureFile(const std::string& jplPath) ...@@ -143,7 +143,7 @@ JamiPluginManager::checkPluginSignatureFile(const std::string& jplPath)
try { try {
auto signatures = PluginUtils::readPluginSignatureFromArchive(jplPath); auto signatures = PluginUtils::readPluginSignatureFromArchive(jplPath);
auto manifest = PluginUtils::readPluginManifestFromArchive(jplPath); auto manifest = PluginUtils::readPluginManifestFromArchive(jplPath);
const std::string& name = manifest["name"]; const std::string& name = manifest["id"];
auto filesPath = archiver::listFilesFromArchive(jplPath); auto filesPath = archiver::listFilesFromArchive(jplPath);
for (const auto& file : filesPath) { for (const auto& file : filesPath) {
// we skip the signatures and signatures.sig file // we skip the signatures and signatures.sig file
...@@ -225,7 +225,7 @@ JamiPluginManager::installPlugin(const std::string& jplPath, bool force) ...@@ -225,7 +225,7 @@ JamiPluginManager::installPlugin(const std::string& jplPath, bool force)
if (std::filesystem::is_regular_file(jplPath)) { if (std::filesystem::is_regular_file(jplPath)) {
try { try {
auto manifestMap = PluginUtils::readPluginManifestFromArchive(jplPath); auto manifestMap = PluginUtils::readPluginManifestFromArchive(jplPath);
const std::string& name = manifestMap["name"]; const std::string& name = manifestMap["id"];
if (name.empty()) if (name.empty())
return INVALID_PLUGIN; return INVALID_PLUGIN;
auto cert = checkPluginCertificate(jplPath, force); auto cert = checkPluginCertificate(jplPath, force);
...@@ -294,7 +294,7 @@ JamiPluginManager::uninstallPlugin(const std::string& rootPath) ...@@ -294,7 +294,7 @@ JamiPluginManager::uninstallPlugin(const std::string& rootPath)
for (const auto& accId : jami::Manager::instance().getAccountList()) for (const auto& accId : jami::Manager::instance().getAccountList())
dhtnet::fileutils::removeAll(fileutils::get_data_dir() + DIR_SEPARATOR_CH + accId dhtnet::fileutils::removeAll(fileutils::get_data_dir() + DIR_SEPARATOR_CH + accId
+ DIR_SEPARATOR_CH + "plugins" + DIR_SEPARATOR_CH + DIR_SEPARATOR_CH + "plugins" + DIR_SEPARATOR_CH
+ detailsIt->second.at("name")); + detailsIt->second.at("id"));
pluginDetailsMap_.erase(detailsIt); pluginDetailsMap_.erase(detailsIt);
} }
return dhtnet::fileutils::removeAll(rootPath); return dhtnet::fileutils::removeAll(rootPath);
......
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
* @param reset If true, overrides previous details values * @param reset If true, overrides previous details values
* Reset is only used in the UT for now, but it can be useful * Reset is only used in the UT for now, but it can be useful
* if we want to reset plugins language without restarting the application * if we want to reset plugins language without restarting the application
* @return Map where the keyset is {"id", "name", "description", "version", "iconPath", "imagePath","soPath"} * @return Map where the keyset is {"id", "name", "description", "version", "iconPath", "backgroundPath","soPath"}
*/ */
std::map<std::string, std::string> getPluginDetails(const std::string& rootPath, bool reset = false); std::map<std::string, std::string> getPluginDetails(const std::string& rootPath, bool reset = false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment