Remove overloaded GetRetroshareInvite method

now the original method has default paramether that return invite for
  own node, this way JSON API is more friendly
This commit is contained in:
Gioacchino Mazzurco 2018-10-04 19:14:16 +02:00
parent 7cc15c703c
commit 7c986b926d
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
3 changed files with 9 additions and 24 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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