mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 06:09:09 -04:00
Finished Notifications in p3ServiceControl:
- added extra Mutex to make notifications work. - Added ServiceControl tick to ServiceServer. - switched p3discovery2 from pqiMonitor -> pqiServiceMonitor git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7201 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
708f6d6b43
commit
a06064e167
6 changed files with 212 additions and 66 deletions
|
@ -1063,45 +1063,49 @@ void p3discovery2::recvPGPCertificate(const SSLID &fromId, RsDiscPgpCertItem *it
|
|||
|
||||
|
||||
|
||||
/************* from pqiMonitor *******************/
|
||||
void p3discovery2::statusChange(const std::list<pqipeer> &plist)
|
||||
/************* from pqiServiceMonitor *******************/
|
||||
void p3discovery2::statusChange(const std::list<pqiServicePeer> &plist)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
//#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::statusChange()" << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
std::list<pqipeer>::const_iterator pit;
|
||||
std::list<pqiServicePeer>::const_iterator pit;
|
||||
for(pit = plist.begin(); pit != plist.end(); pit++)
|
||||
{
|
||||
if ((pit->state & RS_PEER_S_FRIEND) && (pit->actions & RS_PEER_CONNECTED))
|
||||
if (pit->actions & RS_SERVICE_PEER_CONNECTED)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
//#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::statusChange() Starting Disc with: " << pit->id << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
sendOwnContactInfo(pit->id);
|
||||
}
|
||||
else if (!(pit->state & RS_PEER_S_FRIEND) && (pit->actions & RS_PEER_MOVED))
|
||||
else if (pit->actions & RS_SERVICE_PEER_DISCONNECTED)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::statusChange() Removing Friend: " << pit->id << std::endl;
|
||||
#endif
|
||||
removeFriend(pit->id);
|
||||
std::cerr << "p3discovery2::statusChange() Disconnected: " << pit->id << std::endl;
|
||||
}
|
||||
else if ((pit->state & RS_PEER_S_FRIEND) && (pit->actions & RS_PEER_NEW))
|
||||
|
||||
if (pit->actions & RS_SERVICE_PEER_NEW)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
//#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::statusChange() Adding Friend: " << pit->id << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
addFriend(pit->id);
|
||||
}
|
||||
else if (pit->actions & RS_SERVICE_PEER_REMOVED)
|
||||
{
|
||||
//#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::statusChange() Removing Friend: " << pit->id << std::endl;
|
||||
//#endif
|
||||
removeFriend(pit->id);
|
||||
}
|
||||
}
|
||||
#ifdef P3DISC_DEBUG
|
||||
//#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::statusChange() finished." << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************************/
|
||||
/* Extracting Network Graph Details */
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "pqi/p3linkmgr.h"
|
||||
#include "pqi/p3netmgr.h"
|
||||
|
||||
#include "pqi/pqimonitor.h"
|
||||
#include "pqi/pqiservicemonitor.h"
|
||||
#include "serialiser/rsdiscovery2items.h"
|
||||
#include "services/p3service.h"
|
||||
#include "pqi/authgpg.h"
|
||||
|
@ -74,7 +74,7 @@ void mergeFriendList(const std::list<PGPID> &friends);
|
|||
|
||||
|
||||
|
||||
class p3discovery2: public RsDisc, public p3Service, public pqiMonitor, public AuthGPGService
|
||||
class p3discovery2: public RsDisc, public p3Service, public pqiServiceMonitor, public AuthGPGService
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -83,9 +83,9 @@ virtual ~p3discovery2();
|
|||
|
||||
virtual RsServiceInfo getServiceInfo();
|
||||
|
||||
/************* from pqiMonitor *******************/
|
||||
virtual void statusChange(const std::list<pqipeer> &plist);
|
||||
/************* from pqiMonitor *******************/
|
||||
/************* from pqiServiceMonitor *******************/
|
||||
virtual void statusChange(const std::list<pqiServicePeer> &plist);
|
||||
/************* from pqiServiceMonitor *******************/
|
||||
|
||||
int tick();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue