Add getAddressWithoutGruu to Identity address and create participant without gruu

This commit is contained in:
Benjamin Reis 2017-12-01 17:34:07 +01:00
parent 47cf1d436c
commit d835f50943
4 changed files with 9 additions and 7 deletions

View file

@ -130,6 +130,12 @@ bool IdentityAddress::setGruu (const string &gruu) {
return true;
}
IdentityAddress IdentityAddress::getAddressWithoutGruu () const {
IdentityAddress address(*this);
address.setGruu("");
return address;
}
string IdentityAddress::asString () const {
Address tmpAddress(*this);
return tmpAddress.asStringUriOnly();

View file

@ -57,6 +57,8 @@ public:
const std::string &getGruu () const;
bool setGruu (const std::string &gruu);
IdentityAddress getAddressWithoutGruu () const;
virtual std::string asString () const;
private:

View file

@ -88,12 +88,7 @@ void ParticipantPrivate::removeDevice (const IdentityAddress &gruu) {
Participant::Participant (const IdentityAddress &address) : Object(*new ParticipantPrivate) {
L_D();
d->addr = address;
}
Participant::Participant (IdentityAddress &&address) : Object(*new ParticipantPrivate) {
L_D();
d->addr = address;
d->addr = address.getAddressWithoutGruu();
}
// -----------------------------------------------------------------------------

View file

@ -57,7 +57,6 @@ public:
L_OVERRIDE_SHARED_FROM_THIS(Participant);
explicit Participant (const IdentityAddress &address);
explicit Participant (IdentityAddress &&address);
const IdentityAddress &getAddress () const;
bool isAdmin () const;