Commit 53797a32 authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud

account: get user uri

Ring account: returns the registered name or falls back on ring id
SIP account: returns the account's sip uri

Change-Id: I9bc2fa579dde41b8ee9378e2b56681db1d6aaeda
parent b4c6a219
......@@ -3457,5 +3457,14 @@ void RingAccount::pushNotificationReceived(const std::string& from, const std::m
dht_.pushNotificationReceived(data);
}
std::string
RingAccount::getUserUri() const
{
#ifdef HAVE_RINGNS
if (not registeredName_.empty())
return RING_URI_PREFIX + registeredName_;
#endif
return username_;
}
} // namespace ring
......@@ -376,6 +376,8 @@ class RingAccount : public SIPAccountBase {
*/
void pushNotificationReceived(const std::string& from, const std::map<std::string, std::string>& data);
std::string getUserUri() const override;
private:
NON_COPYABLE(RingAccount);
......
......@@ -2101,4 +2101,10 @@ SIPAccount::sendTextMessage(const std::string& to, const std::map<std::string, s
}
}
std::string
SIPAccount::getUserUri() const
{
return getFromUri();
}
} // namespace ring
......@@ -494,6 +494,8 @@ class SIPAccount : public SIPAccountBase {
void connectivityChanged() override;
std::string getUserUri() const override;
private:
void doRegister1_();
void doRegister2_();
......
......@@ -274,6 +274,8 @@ public:
void connectivityChanged() override {};
virtual std::string getUserUri() const = 0;
public: // overloaded methods
virtual void flush() override;
......
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