26using ChatHandlerList = std::map<std::pair<std::string, std::string>, std::map<std::string, bool>>;
44 const std::string& accountId =
"");
56 const std::string& accountId =
"");
87 static std::vector<std::map<std::string, std::string>>
getPreferences(
88 const std::filesystem::path&
rootPath,
const std::string& accountId =
"");
97 const std::filesystem::path&
rootPath,
const std::string& accountId =
"");
106 const std::filesystem::path&
rootPath,
const std::string& accountId =
"");
149 const std::string& accountId);
Static class that gathers functions to manage plugins' preferences.
static std::map< std::string, std::string > getPreferencesValuesMap(const std::filesystem::path &rootPath, const std::string &accountId="")
Reads preferences values.
static void getAllowDenyListPreferences(ChatHandlerList &list)
Reads ChantHandlers status from allowdeny.msgpack file.
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 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::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 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::filesystem::path getAllowDenyListsPath()
Returns the path to allowdeny.msgpack file.
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 void setAllowDenyListPreferences(const ChatHandlerList &list)
Saves ChantHandlers status provided by list.
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....
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 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.
void emitSignal(Args... args)
std::map< std::pair< std::string, std::string >, std::map< std::string, bool > > ChatHandlerList