|
Ring Daemon
|
Static class that gathers functions to manage plugins' preferences. More...
#include <pluginpreferencesutils.h>

Static Public Member Functions | |
| static void | addAlwaysHandlerPreference (const std::string &handlerName, const std::string &rootPath) |
| Creates a "always" preference for a handler if this preference doesn't exist yet. | |
| static std::string | convertArrayToString (const Json::Value &jsonArray) |
| Returns a colon separated string with values from a json::Value containing an array. | |
| static void | getAllowDenyListPreferences (ChatHandlerList &list) |
| Reads ChantHandlers status from allowdeny.msgpack file. | |
| static std::filesystem::path | getAllowDenyListsPath () |
| Returns the path to allowdeny.msgpack file. | |
| static bool | getAlwaysPreference (const std::string &rootPath, const std::string &handlerName, const std::string &accountId) |
| Read plugin's preferences and returns wheter a specific handler "always" preference is True or False. | |
| static std::vector< std::map< std::string, std::string > > | getPreferences (const std::filesystem::path &rootPath, const std::string &accountId="") |
| Reads a preference.json file from the plugin installed in rootPath. | |
| static std::filesystem::path | getPreferencesConfigFilePath (const std::filesystem::path &rootPath, const std::string &accountId="") |
| Given a plugin installation path, returns the path to the preference.json of this plugin. | |
| static std::map< std::string, std::string > | getPreferencesValuesMap (const std::filesystem::path &rootPath, const std::string &accountId="") |
| Reads preferences values. | |
| static std::map< std::string, std::string > | getUserPreferencesValuesMap (const std::filesystem::path &rootPath, const std::string &accountId="") |
| Reads preferences values which were modified from defaultValue. | |
| static std::map< std::string, std::string > | parsePreferenceConfig (const Json::Value &jsonPreference) |
| Parses a single preference from json::Value to a Map<string, string>. | |
| static bool | resetPreferencesValuesMap (const std::string &rootPath, const std::string &accountId) |
| Resets all preferences values to their defaultValues by erasing all data saved in preferences.msgpack. | |
| static void | setAllowDenyListPreferences (const ChatHandlerList &list) |
| Saves ChantHandlers status provided by list. | |
| static std::filesystem::path | valuesFilePath (const std::filesystem::path &rootPath, const std::string &accountId="") |
| Given a plugin installation path, returns the path to the preference.msgpack file. | |
Static class that gathers functions to manage plugins' preferences.
Definition at line 32 of file pluginpreferencesutils.h.
|
static |
Creates a "always" preference for a handler if this preference doesn't exist yet.
A "always" preference tells the Plugin System if in the event of a new call or chat message, the handler is suposed to be automatically activated.
| handlerName | |
| rootPath |
Definition at line 294 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), and getPreferencesConfigFilePath().

|
static |
Returns a colon separated string with values from a json::Value containing an array.
| jsonArray |
Definition at line 58 of file pluginpreferencesutils.cpp.
References convertArrayToString(), and jami::emitSignal().
Referenced by convertArrayToString(), and parsePreferenceConfig().

|
static |
Reads ChantHandlers status from allowdeny.msgpack file.
| [out] | list |
Definition at line 261 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), getAllowDenyListsPath(), and JAMI_ERR.
Referenced by jami::ChatServicesManager::ChatServicesManager().

|
static |
Returns the path to allowdeny.msgpack file.
The allowdeny.msgpack file persists ChatHandlers status for each conversation this handler was previously (de)activated.
Definition at line 52 of file pluginpreferencesutils.cpp.
References jami::fileutils::get_data_dir().
Referenced by getAllowDenyListPreferences(), and setAllowDenyListPreferences().

|
static |
Read plugin's preferences and returns wheter a specific handler "always" preference is True or False.
| rootPath | |
| handlerName | |
| accountId |
Definition at line 354 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), getPreferences(), and getPreferencesValuesMap().
Referenced by jami::CallServicesManager::createAVSubject(), and jami::ChatServicesManager::publishMessage().

|
static |
Reads a preference.json file from the plugin installed in rootPath.
| rootPath | |
| accountId |
Definition at line 98 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), jami::PluginUtils::getLanguage(), jami::PluginUtils::getLocales(), getPreferencesConfigFilePath(), JAMI_ERR, parsePreferenceConfig(), jami::string_remove_suffix(), and jami::string_replace().
Referenced by getAlwaysPreference(), jami::JamiPluginManager::getPluginPreferences(), getPreferencesValuesMap(), and jami::JamiPluginManager::setPluginPreference().

|
static |
Given a plugin installation path, returns the path to the preference.json of this plugin.
| rootPath | |
| accountId |
Definition at line 32 of file pluginpreferencesutils.cpp.
References jami::emitSignal().
Referenced by addAlwaysHandlerPreference(), and getPreferences().

|
static |
Reads preferences values.
| rootPath | |
| accountId |
Definition at line 193 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), getPreferences(), and getUserPreferencesValuesMap().
Referenced by getAlwaysPreference(), jami::JamiPluginManager::getPluginPreferencesValuesMap(), and jami::JamiPluginManager::setPluginPreference().

|
static |
Reads preferences values which were modified from defaultValue.
| rootPath | |
| accountId |
Definition at line 158 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), JAMI_ERR, and valuesFilePath().
Referenced by getPreferencesValuesMap(), and jami::JamiPluginManager::setPluginPreference().

|
static |
Parses a single preference from json::Value to a Map<string, string>.
| jsonPreference |
Definition at line 81 of file pluginpreferencesutils.cpp.
References convertArrayToString(), and jami::emitSignal().
Referenced by getPreferences().

|
static |
Resets all preferences values to their defaultValues by erasing all data saved in preferences.msgpack.
| rootPath | |
| accountId |
Definition at line 223 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), JAMI_ERR, and valuesFilePath().
Referenced by jami::JamiPluginManager::resetPluginPreferencesValuesMap().

|
static |
Saves ChantHandlers status provided by list.
| [in] | list |
Definition at line 245 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), getAllowDenyListsPath(), and JAMI_ERR.
Referenced by jami::ChatServicesManager::publishMessage().

|
static |
Given a plugin installation path, returns the path to the preference.msgpack file.
The preference.msgpack file saves the actuall preferences values if they were modified.
| rootPath | |
| accountId |
Definition at line 41 of file pluginpreferencesutils.cpp.
References jami::emitSignal(), and jami::fileutils::get_data_dir().
Referenced by getUserPreferencesValuesMap(), resetPreferencesValuesMap(), and jami::JamiPluginManager::setPluginPreference().
