webui: added chat

This commit is contained in:
electron128 2015-07-29 15:02:10 +02:00 committed by cave beat
parent 1939ea9f54
commit a9ef48d133
14 changed files with 1621 additions and 44 deletions

View file

@ -2,6 +2,7 @@
#include "ResourceRouter.h"
#include "StateTokenServer.h"
#include "ChatHandler.h"
#include <retroshare/rsnotify.h>
#include <util/rsthreads.h>
@ -11,7 +12,7 @@ class RsMsgs;
namespace resource_api
{
class PeersHandler: public ResourceRouter, NotifyClient, Tickable
class PeersHandler: public ResourceRouter, NotifyClient, Tickable, public UnreadMsgNotify
{
public:
PeersHandler(StateTokenServer* sts, RsNotify* notify, RsPeers* peers, RsMsgs* msgs);
@ -24,6 +25,12 @@ public:
// from Tickable
virtual void tick();
// from UnreadMsgNotify
// ChatHandler calls this to tell us about unreadmsgs
// this allows to merge unread msgs info with the peers list
virtual void notifyUnreadMsgCountChanged(const RsPeerId& peer, uint32_t count);
private:
void handleWildcard(Request& req, Response& resp);
void handleExamineCert(Request& req, Response& resp);
@ -40,5 +47,6 @@ private:
RsMutex mMtx;
StateToken mStateToken; // mutex protected
std::map<RsPeerId, uint32_t> mUnreadMsgsCounts;
};
} // namespace resource_api