Commit c2f1bed0 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

* #29736: presence: Peer review changes

parent 8c6633be
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<node name="/presencemanager-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> <node name="/presencemanager-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.sflphone.SFLphone.PresenceManager"> <interface name="org.sflphone.SFLphone.PresenceManager">
<!-- METHODS !--> <!-- METHODS !-->
<method name="sendPresence" tp:name-for-bindings="sendPresence"> <method name="publish" tp:name-for-bindings="publish">
<tp:added version="1.3.0"/> <tp:added version="1.3.0"/>
<arg type="s" name="accountID" direction="in"> <arg type="s" name="accountID" direction="in">
<tp:docstring> <tp:docstring>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</arg> </arg>
</method> </method>
<method name="approvePresSubServer" tp:name-for-bindings="approvePresSubServer"> <method name="answerServerRequest" tp:name-for-bindings="answerServerRequest">
<tp:docstring> <tp:docstring>
Answer a presence request from the server Answer a presence request from the server
</tp:docstring> </tp:docstring>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</arg> </arg>
</method> </method>
<method name="subscribeClient" tp:name-for-bindings="subscribeClient"> <method name="subscribeBuddy" tp:name-for-bindings="subscribeBuddy">
<tp:docstring> <tp:docstring>
Ask be be notified when 'uri' presence change Ask be be notified when 'uri' presence change
</tp:docstring> </tp:docstring>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<!-- SIGNALS !--> <!-- SIGNALS !-->
<signal name="newClientSubscription" tp:name-for-bindings="newClientSubscription"> <signal name="newBuddySubscription" tp:name-for-bindings="newBuddySubscription">
<tp:added version="1.3.0"/> <tp:added version="1.3.0"/>
<tp:docstring> <tp:docstring>
Notify when a registered presence uri presence informations changes Notify when a registered presence uri presence informations changes
......
...@@ -59,7 +59,7 @@ PresenceManager::PresenceManager(DBus::Connection& connection) : ...@@ -59,7 +59,7 @@ PresenceManager::PresenceManager(DBus::Connection& connection) :
* Un/subscribe to buddySipUri for an accountID * Un/subscribe to buddySipUri for an accountID
*/ */
void void
PresenceManager::subscribeClient(const std::string& accountID, const std::string& uri, const bool& flag) PresenceManager::subscribeBuddy(const std::string& accountID, const std::string& uri, const bool& flag)
{ {
SIPAccount *sipaccount = Manager::instance().getSipAccount(accountID); SIPAccount *sipaccount = Manager::instance().getSipAccount(accountID);
...@@ -76,7 +76,7 @@ PresenceManager::subscribeClient(const std::string& accountID, const std::string ...@@ -76,7 +76,7 @@ PresenceManager::subscribeClient(const std::string& accountID, const std::string
* Notify for IP2IP account and publish for PBX account * Notify for IP2IP account and publish for PBX account
*/ */
void void
PresenceManager::sendPresence(const std::string& accountID, const bool& status, const std::string& note) PresenceManager::publish(const std::string& accountID, const bool& status, const std::string& note)
{ {
SIPAccount *sipaccount = Manager::instance().getSipAccount(accountID); SIPAccount *sipaccount = Manager::instance().getSipAccount(accountID);
if (!sipaccount) if (!sipaccount)
...@@ -91,7 +91,7 @@ PresenceManager::sendPresence(const std::string& accountID, const bool& status, ...@@ -91,7 +91,7 @@ PresenceManager::sendPresence(const std::string& accountID, const bool& status,
* Accept or not a PresSubServer request for IP2IP account * Accept or not a PresSubServer request for IP2IP account
*/ */
void void
PresenceManager::approvePresSubServer(const std::string& uri, const bool& flag) PresenceManager::answerServerRequest(const std::string& uri, const bool& flag)
{ {
SIPAccount *sipaccount = Manager::instance().getIP2IPAccount(); SIPAccount *sipaccount = Manager::instance().getIP2IPAccount();
if (!sipaccount) if (!sipaccount)
......
...@@ -77,14 +77,14 @@ class PresenceManager ...@@ -77,14 +77,14 @@ class PresenceManager
#endif #endif
#ifdef __ANDROID__ #ifdef __ANDROID__
void newClientSubscription(const std::string& uri, const std::string& basic, const std::string& note); void newBuddySubscription(const std::string& uri, const std::string& basic, const std::string& note);
void newServerSubscriptionRequest(const std::string& remote); void newServerSubscriptionRequest(const std::string& remote);
#endif //__ANDROID__ #endif //__ANDROID__
/* Presence subscription/Notification. */ /* Presence subscription/Notification. */
void sendPresence(const std::string& accountID, const bool& status, const std::string& note); void publish(const std::string& accountID, const bool& status, const std::string& note);
void approvePresSubServer(const std::string& uri, const bool& flag); void answerServerRequest(const std::string& uri, const bool& flag);
void subscribeClient(const std::string& accountID, const std::string& uri, const bool& flag); void subscribeBuddy(const std::string& accountID, const std::string& uri, const bool& flag);
std::vector<std::map<std::string, std::string> > getSubscriptions(const std::string& accountID); std::vector<std::map<std::string, std::string> > getSubscriptions(const std::string& accountID);
void setSubscriptions(const std::string& accountID, const std::vector<std::string>& uris); void setSubscriptions(const std::string& accountID, const std::vector<std::string>& uris);
......
...@@ -141,7 +141,7 @@ void SIPPresence::reportPresSubClientNotification(const std::string& uri, pjsip_ ...@@ -141,7 +141,7 @@ void SIPPresence::reportPresSubClientNotification(const std::string& uri, pjsip_
const std::string note(status->info[0].rpid.note.ptr,status->info[0].rpid.note.slen); const std::string note(status->info[0].rpid.note.ptr,status->info[0].rpid.note.slen);
DEBUG(" Received status of PresSubClient %s: status=%s note=%s",uri.c_str(),(status->info[0].basic_open?"open":"closed"),note.c_str()); DEBUG(" Received status of PresSubClient %s: status=%s note=%s",uri.c_str(),(status->info[0].basic_open?"open":"closed"),note.c_str());
/* report status to client signal */ /* report status to client signal */
Manager::instance().getClient()->getPresenceManager()->newClientSubscription(uri, status->info[0].basic_open, note); Manager::instance().getClient()->getPresenceManager()->newBuddySubscription(uri, status->info[0].basic_open, note);
} }
void SIPPresence::subscribeClient(const std::string& uri, const bool& flag){ void SIPPresence::subscribeClient(const std::string& uri, const bool& flag){
......
Supports Markdown
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