|
Ring Daemon
|
#include <presence_manager.h>

Public Types | |
| using | DevicePresenceCallback = std::function< void(const std::string &uri, const dht::PkId &deviceId, bool online)> |
| using | PresenceCallback = std::function< void(const std::string &uri, bool online)> |
Public Member Functions | |
| uint64_t | addDeviceListener (DevicePresenceCallback cb) |
| Add a listener for device presence changes. | |
| uint64_t | addListener (PresenceCallback cb) |
| Add a listener for presence changes. | |
| std::vector< dht::PkId > | getDevices (const std::string &uri) const |
| Get the list of devices for a tracked buddy. | |
| std::map< std::string, bool > | getTrackedBuddyPresence () const |
| Get the presence status of all tracked buddies. | |
| bool | isOnline (const std::string &uri) const |
| Check if a buddy is currently online. | |
| PresenceManager (const std::shared_ptr< dht::DhtRunner > &dht) | |
| void | refresh () |
| Refresh all tracked buddies. | |
| void | removeDeviceListener (uint64_t token) |
| Remove a listener using the token returned by addDeviceListener. | |
| void | removeListener (uint64_t token) |
| Remove a listener using the token returned by addListener. | |
| void | trackBuddy (const std::string &uri) |
| Start tracking a buddy. | |
| void | untrackBuddy (const std::string &uri) |
| Stop tracking a buddy. | |
| ~PresenceManager () | |
Definition at line 34 of file presence_manager.h.
| using jami::PresenceManager::DevicePresenceCallback = std::function<void(const std::string& uri, const dht::PkId& deviceId, bool online)> |
Definition at line 38 of file presence_manager.h.
| using jami::PresenceManager::PresenceCallback = std::function<void(const std::string& uri, bool online)> |
Definition at line 37 of file presence_manager.h.
| jami::PresenceManager::PresenceManager | ( | const std::shared_ptr< dht::DhtRunner > & | dht | ) |
Definition at line 24 of file presence_manager.cpp.
| jami::PresenceManager::~PresenceManager | ( | ) |
Definition at line 28 of file presence_manager.cpp.
References jami::emitSignal().

| uint64_t jami::PresenceManager::addDeviceListener | ( | DevicePresenceCallback | cb | ) |
Add a listener for device presence changes.
The callback will be called whenever a device of a tracked buddy goes online or offline.
Definition at line 129 of file presence_manager.cpp.
References jami::emitSignal().

| uint64_t jami::PresenceManager::addListener | ( | PresenceCallback | cb | ) |
Add a listener for presence changes.
The callback will be called whenever a tracked buddy goes online or offline.
Definition at line 113 of file presence_manager.cpp.
References jami::emitSignal().

| std::vector< dht::PkId > jami::PresenceManager::getDevices | ( | const std::string & | uri | ) | const |
Get the list of devices for a tracked buddy.
Definition at line 100 of file presence_manager.cpp.
References jami::emitSignal().

| std::map< std::string, bool > jami::PresenceManager::getTrackedBuddyPresence | ( | ) | const |
Get the presence status of all tracked buddies.
Definition at line 89 of file presence_manager.cpp.
References jami::emitSignal().

Check if a buddy is currently online.
Definition at line 78 of file presence_manager.cpp.
References jami::emitSignal().

| void jami::PresenceManager::refresh | ( | ) |
Refresh all tracked buddies.
This should be called when the DHT is restarted.
Definition at line 145 of file presence_manager.cpp.
References jami::emitSignal().

Remove a listener using the token returned by addDeviceListener.
Definition at line 138 of file presence_manager.cpp.
Remove a listener using the token returned by addListener.
Definition at line 122 of file presence_manager.cpp.
Start tracking a buddy.
Increments the reference count for the given URI. If the buddy was not tracked, it starts listening on the DHT.
Definition at line 39 of file presence_manager.cpp.
References jami::emitSignal().

Stop tracking a buddy.
Decrements the reference count. If the count reaches zero, stops listening on the DHT.
Definition at line 58 of file presence_manager.cpp.
References jami::emitSignal().
