mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 14:12:43 -04:00
Experiment of notification via NotifyClient + JSON API
This commit is contained in:
parent
130007b578
commit
1bc518041c
5 changed files with 142 additions and 50 deletions
|
@ -19,16 +19,12 @@
|
|||
#include <string>
|
||||
#include <memory>
|
||||
#include <restbed>
|
||||
#include <rapid_json/document.h>
|
||||
|
||||
#include "retroshare/rsgxschannels.h"
|
||||
#include "serialiser/rstypeserializer.h"
|
||||
#include "util/rsthreads.h"
|
||||
#include "retroshare/rsnotify.h"
|
||||
|
||||
namespace rb = restbed;
|
||||
|
||||
void apiVersionHandler(const std::shared_ptr<rb::Session> session);
|
||||
void createChannelHandler(const std::shared_ptr<rb::Session> session);
|
||||
|
||||
/**
|
||||
* Simple usage
|
||||
|
@ -74,5 +70,20 @@ private:
|
|||
uint16_t mPort;
|
||||
rb::Service mService;
|
||||
const std::function<void(int)> mShutdownCallback;
|
||||
|
||||
std::list<std::shared_ptr<rb::Session> > notifySessions;
|
||||
void cleanClosedNotifySessions();
|
||||
|
||||
struct NotifyClientWrapper : NotifyClient
|
||||
{
|
||||
NotifyClientWrapper(JsonApiServer& parent);
|
||||
|
||||
void notifyTurtleSearchResult(
|
||||
uint32_t searchId, const std::list<TurtleFileInfo>& files);
|
||||
|
||||
private:
|
||||
JsonApiServer& mJsonApiServer;
|
||||
};
|
||||
NotifyClientWrapper notifyClientWrapper;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue