|
Ring Daemon
|
This class provides the interface between loaded ChatHandlers and conversation messages. More...
#include <chatservicesmanager.h>

Public Member Functions | |
| ChatServicesManager (PluginManager &pluginManager) | |
| Constructor registers ChatHandler API services to the PluginManager instance. | |
| void | cleanChatSubjects (const std::string &accountId, const std::string &peerId="") |
| If an account is unregistered or a contact is erased, we clear all chat subjects related to that accountId or to the accountId, peerId pair. | |
| std::map< std::string, std::string > | getChatHandlerDetails (const std::string &chatHandlerIdStr) |
| Gets details from ChatHandler implementation. | |
| std::vector< std::string > | getChatHandlers () const |
| List all ChatHandlers available. | |
| std::vector< std::string > | getChatHandlerStatus (const std::string &accountId, const std::string &peerId) |
| Returns a list of active ChatHandlers for a given accountId, peerId pair. | |
| bool | hasHandlers () const |
| NON_COPYABLE (ChatServicesManager) | |
| void | publishMessage (const pluginMessagePtr &message) |
| Publishes every message sent or received in a conversation that has (or should have) an active ChatHandler. | |
| bool | setPreference (const std::string &key, const std::string &value, const std::string &rootPath) |
| Sets a preference that may be changed while ChatHandler is active. | |
| void | toggleChatHandler (const std::string &chatHandlerId, const std::string &accountId, const std::string &peerId, const bool toggle) |
| Activates or deactivate a given ChatHandler to a given accountId, peerId pair. | |
This class provides the interface between loaded ChatHandlers and conversation messages.
Besides it: (1) stores pointers to all loaded ChatHandlers; (2) stores pointers to availables chat subjects, and; (3) lists ChatHandler state with respect to each accountId, peerId pair. In other words, for a given accountId, peerId pair, we store if a ChatHandler is active or not.
Definition at line 37 of file chatservicesmanager.h.
| jami::ChatServicesManager::ChatServicesManager | ( | PluginManager & | pluginManager | ) |
Constructor registers ChatHandler API services to the PluginManager instance.
These services will store ChatHandler pointers, clean them from the Plugin System once a plugin is loaded or unloaded, or yet allows the plugins to send a message to a conversation.
| pluginManager |
Definition at line 27 of file chatservicesmanager.cpp.
References jami::emitSignal(), and jami::PluginPreferencesUtils::getAllowDenyListPreferences().

| void jami::ChatServicesManager::cleanChatSubjects | ( | const std::string & | accountId, |
| const std::string & | peerId = "" |
||
| ) |
If an account is unregistered or a contact is erased, we clear all chat subjects related to that accountId or to the accountId, peerId pair.
| accountId | |
| peerId |
Definition at line 165 of file chatservicesmanager.cpp.
References jami::emitSignal().

| std::map< std::string, std::string > jami::ChatServicesManager::getChatHandlerDetails | ( | const std::string & | chatHandlerIdStr | ) |
Gets details from ChatHandler implementation.
| chatHandlerIdStr |
Definition at line 206 of file chatservicesmanager.cpp.
References jami::emitSignal().

| std::vector< std::string > jami::ChatServicesManager::getChatHandlers | ( | ) | const |
List all ChatHandlers available.
Definition at line 113 of file chatservicesmanager.cpp.
References jami::emitSignal().

| std::vector< std::string > jami::ChatServicesManager::getChatHandlerStatus | ( | const std::string & | accountId, |
| const std::string & | peerId | ||
| ) |
Returns a list of active ChatHandlers for a given accountId, peerId pair.
| accountId | |
| peerId |
Definition at line 188 of file chatservicesmanager.cpp.
References jami::emitSignal().

| bool jami::ChatServicesManager::hasHandlers | ( | ) | const |
Definition at line 107 of file chatservicesmanager.cpp.
References jami::emitSignal().

| jami::ChatServicesManager::NON_COPYABLE | ( | ChatServicesManager | ) |
| void jami::ChatServicesManager::publishMessage | ( | const pluginMessagePtr & | message | ) |
Publishes every message sent or received in a conversation that has (or should have) an active ChatHandler.
| message |
Definition at line 124 of file chatservicesmanager.cpp.
References DIR_SEPARATOR_CH, jami::emitSignal(), jami::PluginPreferencesUtils::getAlwaysPreference(), and jami::PluginPreferencesUtils::setAllowDenyListPreferences().

| bool jami::ChatServicesManager::setPreference | ( | const std::string & | key, |
| const std::string & | value, | ||
| const std::string & | rootPath | ||
| ) |
Sets a preference that may be changed while ChatHandler is active.
| key | |
| value | |
| rootPath |
Definition at line 218 of file chatservicesmanager.cpp.
References jami::emitSignal().
Referenced by jami::JamiPluginManager::setPluginPreference().

| void jami::ChatServicesManager::toggleChatHandler | ( | const std::string & | chatHandlerId, |
| const std::string & | accountId, | ||
| const std::string & | peerId, | ||
| const bool | toggle | ||
| ) |
Activates or deactivate a given ChatHandler to a given accountId, peerId pair.
| ChatHandlerId | |
| accountId | |
| peerId | |
| toggle | Notify with new subjects if true, detach if false. |
Definition at line 179 of file chatservicesmanager.cpp.
References jami::emitSignal(), and toggleChatHandler().
Referenced by toggleChatHandler().
