Commit d44b08f8 authored by aviau's avatar aviau Committed by Andreas Traczyk

presencemanager: move consts in Presence namespace

Move presence-related constants in a DRing::Presence namespace.
They could be used by clients, and DRing::BUDDY_KEY is too
broad.

This commit assumes that they are not used already. It breaks the API.

Tuleap: #1379
Change-Id: Iff2f7a3243109350dd89051695d846290bae0486
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 4d19ca15
......@@ -132,9 +132,9 @@ getSubscriptions(const std::string& accountID)
if (auto pres = sipaccount->getPresence()) {
for (const auto& s : pres->getClientSubscriptions()) {
ret.push_back({
{BUDDY_KEY, s->getURI()},
{STATUS_KEY, s->isPresent() ? ONLINE_KEY : OFFLINE_KEY},
{LINESTATUS_KEY, s->getLineStatus()}
{DRing::Presence::BUDDY_KEY, s->getURI()},
{DRing::Presence::STATUS_KEY, s->isPresent() ? DRing::Presence::ONLINE_KEY : DRing::Presence::OFFLINE_KEY},
{DRing::Presence::LINESTATUS_KEY, s->getLineStatus()}
});
}
} else
......@@ -142,8 +142,8 @@ getSubscriptions(const std::string& accountID)
} else if (auto ringaccount = ring::Manager::instance().getAccount<ring::RingAccount>(accountID)) {
for (const auto& tracked_id : ringaccount->getTrackedBuddyPresence()) {
ret.push_back({
{BUDDY_KEY, tracked_id.first},
{STATUS_KEY, tracked_id.second ? ONLINE_KEY : OFFLINE_KEY}
{DRing::Presence::BUDDY_KEY, tracked_id.first},
{DRing::Presence::STATUS_KEY, tracked_id.second ? DRing::Presence::ONLINE_KEY : DRing::Presence::OFFLINE_KEY}
});
}
} else
......
......@@ -30,12 +30,16 @@
namespace DRing {
namespace Presence {
constexpr static const char* BUDDY_KEY = "Buddy";
constexpr static const char* STATUS_KEY = "Status";
constexpr static const char* LINESTATUS_KEY = "LineStatus";
constexpr static const char* ONLINE_KEY = "Online";
constexpr static const char* OFFLINE_KEY = "Offline";
}
void registerPresHandlers(const std::map<std::string, std::shared_ptr<CallbackWrapperBase>>&);
/* Presence subscription/Notification. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment