Expose RsPeers JSON API

Added also new method for better usability via the API that allow to add
  friend directly for RetroShare invitation (supports also URL) without
  having to call to mulptiple metods to set IP etc.
  RsPeers::acceptInvite
  /rsPeers/acceptInvite
This commit is contained in:
Gioacchino Mazzurco 2018-08-30 21:41:15 +02:00
parent a8ddec03fc
commit cc6f0b1f05
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
3 changed files with 311 additions and 55 deletions

View file

@ -32,6 +32,7 @@
#include "retroshare/rspeers.h"
#include "util/rsurl.h"
#include "util/rsdeprecate.h"
class p3LinkMgr;
class p3PeerMgr;
@ -56,6 +57,11 @@ public:
virtual bool getOnlineList(std::list<RsPeerId> &ids);
virtual bool getFriendList(std::list<RsPeerId> &ids);
virtual bool getPeersCount(
uint32_t& peersCount, uint32_t& onlinePeersCount,
bool countLocations );
RS_DEPRECATED
virtual bool getPeerCount (unsigned int *friendCount, unsigned int *onlineCount, bool ssl);
virtual bool isOnline(const RsPeerId &id);
@ -121,6 +127,11 @@ public:
bool includeExtraLocators = true );
virtual bool GetPGPBase64StringAndCheckSum(const RsPgpId& gpg_id,std::string& gpg_base64_string,std::string& gpg_base64_checksum);
/// @see RsPeers::acceptInvite
virtual bool acceptInvite(
const std::string& invite,
ServicePermissionFlags flags = RS_NODE_PERM_DEFAULT );
virtual bool hasExportMinimal();
virtual bool loadCertificateFromString(const std::string& cert, RsPeerId& ssl_id,RsPgpId& pgp_id, std::string& error_string);