2014-04-13 08:21:51 -04:00
|
|
|
#pragma once
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
// from retroshare
|
|
|
|
#include "retroshare/rsids.h"
|
|
|
|
#include "retroshare/rstypes.h"
|
|
|
|
#include "retroshare/rsgxscircles.h"
|
|
|
|
#include "retroshare/rsidentity.h"
|
|
|
|
|
2014-04-13 08:21:51 -04:00
|
|
|
// from librssimulator
|
|
|
|
#include "peer/PeerNode.h"
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
#include "gxstestservice.h"
|
|
|
|
|
2014-04-13 08:21:51 -04:00
|
|
|
class RsGxsIdExchange;
|
|
|
|
class RsGxsCircleExchange;
|
|
|
|
class GxsTestService;
|
|
|
|
class RsGeneralDataService;
|
|
|
|
class RsGxsNetService;
|
2014-04-27 09:26:14 -04:00
|
|
|
class p3IdService;
|
|
|
|
class p3GxsCircles;
|
|
|
|
class FakePgpAuxUtils;
|
2014-04-13 08:21:51 -04:00
|
|
|
|
|
|
|
class GxsPeerNode: public PeerNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
GxsPeerNode(const RsPeerId &ownId, const std::list<RsPeerId> &peers, int testMode, bool useIdentityService);
|
2014-04-13 08:21:51 -04:00
|
|
|
~GxsPeerNode();
|
|
|
|
|
2014-05-04 08:50:19 -04:00
|
|
|
bool checkTestServiceAllowedGroups(const RsPeerId &peerId);
|
|
|
|
bool checkCircleServiceAllowedGroups(const RsPeerId &peerId);
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
bool createIdentity(const std::string &name,
|
|
|
|
bool pgpLinked,
|
|
|
|
uint32_t circleType,
|
|
|
|
const RsGxsCircleId &circleId,
|
|
|
|
RsGxsId &gxsId);
|
|
|
|
|
|
|
|
bool createCircle(const std::string &name,
|
|
|
|
uint32_t circleType,
|
|
|
|
const RsGxsCircleId &circleId,
|
|
|
|
const RsGxsId &authorId,
|
2015-12-13 11:22:31 -05:00
|
|
|
std::set<RsPgpId> localMembers,
|
|
|
|
std::set<RsGxsId> externalMembers,
|
2014-04-27 09:26:14 -04:00
|
|
|
RsGxsGroupId &groupId);
|
|
|
|
|
|
|
|
bool createGroup(const std::string &name,
|
|
|
|
uint32_t circleType,
|
|
|
|
const RsGxsCircleId &circleId,
|
|
|
|
const RsGxsId &authorId,
|
|
|
|
RsGxsGroupId &groupId);
|
|
|
|
|
|
|
|
bool createMsg(const std::string &msgstr,
|
|
|
|
const RsGxsGroupId &groupId,
|
|
|
|
const RsGxsId &authorId,
|
|
|
|
RsGxsMessageId &msgId);
|
|
|
|
|
|
|
|
bool subscribeToGroup(const RsGxsGroupId &groupId, bool subscribe);
|
|
|
|
|
|
|
|
bool getGroups(std::vector<RsTestGroup> &groups);
|
|
|
|
bool getGroupList(std::list<RsGxsGroupId> &groups);
|
|
|
|
bool getMsgList(const RsGxsGroupId &id, std::list<RsGxsMessageId> &msgIds);
|
|
|
|
|
|
|
|
bool getIdentities(std::vector<RsGxsIdGroup> &groups);
|
|
|
|
bool getIdentitiesList(std::list<RsGxsGroupId> &groups);
|
|
|
|
|
|
|
|
bool getCircles(std::vector<RsGxsCircleGroup> &groups);
|
|
|
|
bool getCirclesList(std::list<RsGxsGroupId> &groups);
|
|
|
|
|
|
|
|
uint32_t mUseIdentityService;
|
2014-04-13 08:21:51 -04:00
|
|
|
uint32_t mTestMode;
|
|
|
|
std::string mGxsDir;
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
FakePgpAuxUtils *mPgpAuxUtils;
|
|
|
|
|
|
|
|
p3IdService *mGxsIdService;
|
|
|
|
p3GxsCircles *mGxsCircles;
|
|
|
|
|
|
|
|
RsGeneralDataService* mGxsIdDs;
|
|
|
|
RsGxsNetService* mGxsIdNs;
|
|
|
|
|
|
|
|
RsGeneralDataService* mGxsCirclesDs;
|
|
|
|
RsGxsNetService* mGxsCirclesNs;
|
2014-04-13 08:21:51 -04:00
|
|
|
|
|
|
|
GxsTestService *mTestService;
|
|
|
|
RsGeneralDataService* mTestDs;
|
|
|
|
RsGxsNetService* mTestNs;
|
|
|
|
};
|
|
|
|
|
|
|
|
|