RetroShare/tests/librssimulator/peer/FakeServiceControl.h
Gioacchino Mazzurco eb77f921ec
Implement JSON API HTTP Basic authentication
jsonapi-generator is now capable of generating API for headers outside
  retroshare/ directory
jsonapi-generator do a bit of methods parameter sanity check
JsonApiServer is now integrated in the rsinit hell like other services
Add *::exportGPGKeyPairToString to a bunch of classes in cascade
RsControl is now capable of calling back a function when retroshare is almost
  completely stopped, this is useful when running retroshare toghether with
  externally managed runloop such as QCoreApplication
Expose a bunch of methods through JSON API
retroshare-nogui remove some dead code and fix stopping from the RetroShare API
2018-09-19 21:28:26 +02:00

36 lines
775 B
C++

#pragma once
#include <iostream>
#include <list>
#include <retroshare/rsids.h>
#include <pqi/p3linkmgr.h>
#include <pqi/p3servicecontrol.h>
class FakeServiceControl: public p3ServiceControl
{
public:
FakeServiceControl(p3LinkMgr *lm)
: p3ServiceControl(lm),mLink(lm)
{
}
virtual void getPeersConnected(uint32_t serviceId, std::set<RsPeerId> &peerSet)
{
(void) serviceId;
std::list<RsPeerId> ids ;
mLink->getOnlineList(ids) ;
for(std::list<RsPeerId>::const_iterator it(ids.begin());it!=ids.end();++it)
peerSet.insert(*it) ;
}
virtual bool checkFilter(uint32_t,const RsPeerId& id)
{
(void) id;
return true ;
}
p3LinkMgr *mLink;
};