Implement a JSON API friendly notification system

This should bit by bit substitute RsNotify which would be very difficult
  to support properly in JSON API.
The new system is much simpler to use also from the C++ side of the
  moon.
BroadcastDiscovery take advantage of the new system to notify about new
  non friend peer discovered, tested successfully also in JSON API.
This commit is contained in:
Gioacchino Mazzurco 2019-04-15 00:12:29 +02:00
parent 9c7a8d479f
commit 7dab487bde
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
9 changed files with 503 additions and 84 deletions

View file

@ -39,6 +39,9 @@ int rsserverzone = 101;
#include "util/rsdebug.h"
#include "retroshare/rsevents.h"
#include "services/rseventsservice.h"
/****
#define DEBUG_TICK 1
@ -81,6 +84,12 @@ RsServer::RsServer() :
coreMutex("RsServer"), mShutdownCallback([](int){}),
coreReady(false)
{
{
RsEventsService* tmpRsEvtPtr = new RsEventsService();
rsEvents.reset(tmpRsEvtPtr);
startServiceThread(tmpRsEvtPtr, "RsEventsService");
}
// This is needed asap.
//
mNotify = new p3Notify() ;