Commit 76c4e7ed authored by Ghislain MARY's avatar Ghislain MARY

Handle IdentityAddress with sips scheme.

parent e1122d15
......@@ -48,7 +48,7 @@ Address::Address (const Address &src) : ClonableObject(*new AddressPrivate) {
Address::Address (const IdentityAddress &src) : ClonableObject(*new AddressPrivate) {
L_D();
string uri = "sip:" + src.getUsername() + "@";
string uri = src.getScheme() + ":" + src.getUsername() + "@";
if (src.getDomain().find(':') != string::npos)
uri += "[" + src.getDomain() + "]";
else
......
......@@ -29,6 +29,7 @@ LINPHONE_BEGIN_NAMESPACE
class IdentityAddressPrivate : public ClonableObjectPrivate {
private:
std::string scheme;
std::string username;
std::string domain;
std::string gruu;
......
......@@ -34,7 +34,8 @@ LINPHONE_BEGIN_NAMESPACE
IdentityAddress::IdentityAddress (const string &address) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
Address tmpAddress(address);
if (tmpAddress.isValid() && (tmpAddress.getScheme() == "sip")) {
if (tmpAddress.isValid() && ((tmpAddress.getScheme() == "sip") || (tmpAddress.getScheme() == "sips"))) {
d->scheme = tmpAddress.getScheme();
d->username = tmpAddress.getUsername();
d->domain = tmpAddress.getDomain();
if (tmpAddress.hasUriParam("gr")) {
......@@ -45,6 +46,7 @@ IdentityAddress::IdentityAddress (const string &address) : ClonableObject(*new I
IdentityAddress::IdentityAddress (const IdentityAddress &src) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
d->gruu = src.getGruu();
......@@ -52,6 +54,7 @@ IdentityAddress::IdentityAddress (const IdentityAddress &src) : ClonableObject(*
IdentityAddress::IdentityAddress (const Address &src) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
if (src.hasUriParam("gr")) {
......@@ -62,6 +65,7 @@ IdentityAddress::IdentityAddress (const Address &src) : ClonableObject(*new Iden
IdentityAddress &IdentityAddress::operator= (const IdentityAddress &src) {
L_D();
if (this != &src) {
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
d->gruu = src.getGruu();
......@@ -86,6 +90,11 @@ bool IdentityAddress::isValid () const {
return tmpAddress.isValid();
}
const string &IdentityAddress::getScheme () const {
L_D();
return d->scheme;
}
const string &IdentityAddress::getUsername () const {
L_D();
return d->username;
......
......@@ -45,6 +45,8 @@ public:
bool isValid () const;
const std::string &getScheme () const;
const std::string &getUsername () const;
bool setUsername (const std::string &username);
......
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