diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index 04634166a..75fd91bbc 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -527,13 +527,15 @@ public: /** * @brief Get RetroShare invite of the given peer * @jsonapi{development} - * @param[in] sslId Id of the peer of which we want to generate an invite + * @param[in] sslId Id of the peer of which we want to generate an invite, + * a null id (all 0) is passed, an invite for own node is returned. * @param[in] includeSignatures true to add key signatures to the invite * @param[in] includeExtraLocators false to avoid to add extra locators * @return invite string */ virtual std::string GetRetroshareInvite( - const RsPeerId& sslId, bool includeSignatures = false, + const RsPeerId& sslId = RsPeerId(), + bool includeSignatures = false, bool includeExtraLocators = true ) = 0; /** @@ -547,15 +549,6 @@ public: const std::string& invite, ServicePermissionFlags flags = RS_NODE_PERM_DEFAULT ) = 0; - /** - * @brief Get RetroShare invite of our own peer - * @param[in] includeSignatures true to add key signatures to the invite - * @param[in] includeExtraLocators false to avoid to add extra locators - * @return invite string - */ - virtual std::string GetRetroshareInvite( - bool includeSignatures = false, - bool includeExtraLocators = true ) = 0; /* Auth Stuff */ virtual std::string getPGPKey(const RsPgpId& pgp_id,bool include_signatures) = 0; diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 616884248..d950d1e26 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -1054,12 +1054,7 @@ bool p3Peers::setProxyServer(const uint32_t type, const std::string &addr_str, c //=========================================================================== /* Auth Stuff */ -std::string p3Peers::GetRetroshareInvite( - bool include_signatures, bool includeExtraLocators ) -{ - return GetRetroshareInvite( - getOwnId(), include_signatures, includeExtraLocators ); -} + std::string p3Peers::getPGPKey(const RsPgpId& pgp_id,bool include_signatures) { unsigned char *mem_block = NULL; @@ -1176,12 +1171,13 @@ bool p3Peers::acceptInvite( const std::string& invite, } std::string p3Peers::GetRetroshareInvite( - const RsPeerId& ssl_id, bool include_signatures, + const RsPeerId& sslId, bool include_signatures, bool includeExtraLocators ) { #ifdef P3PEERS_DEBUG std::cerr << __PRETTY_FUNCTION__ << std::endl; #endif + const RsPeerId& ssl_id(sslId.isNull() ? getOwnId() : sslId); //add the sslid, location, ip local and external address after the signature RsPeerDetails detail; diff --git a/libretroshare/src/rsserver/p3peers.h b/libretroshare/src/rsserver/p3peers.h index 3b96ab380..f5f61a43e 100644 --- a/libretroshare/src/rsserver/p3peers.h +++ b/libretroshare/src/rsserver/p3peers.h @@ -117,14 +117,10 @@ public: /* Auth Stuff */ // Get the invitation (GPG cert + local/ext address + SSL id for the given peer) virtual std::string GetRetroshareInvite( - const RsPeerId& ssl_id, bool include_signatures = false, - bool includeExtraLocators = true ); + const RsPeerId& ssl_id = RsPeerId(), + bool include_signatures = false, bool includeExtraLocators = true ); virtual std::string getPGPKey(const RsPgpId& pgp_id,bool include_signatures); - // same but for own id - virtual std::string GetRetroshareInvite( - bool include_signatures = false, - bool includeExtraLocators = true ); virtual bool GetPGPBase64StringAndCheckSum(const RsPgpId& gpg_id,std::string& gpg_base64_string,std::string& gpg_base64_checksum); /// @see RsPeers::acceptInvite