mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 01:25:17 -04:00
webui:
- added better live reload. It uses the Retroshare built in server. Grunt is not required anymore. - removed unused buttons - started ChatHandler git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8185 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
90d6ac6697
commit
b05ee805e4
13 changed files with 179 additions and 63 deletions
50
libresapi/src/api/ChatHandler.h
Normal file
50
libresapi/src/api/ChatHandler.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
#pragma once
|
||||
|
||||
#include "ResourceRouter.h"
|
||||
#include "StateTokenServer.h"
|
||||
#include <retroshare/rsnotify.h>
|
||||
|
||||
class RsMsgs;
|
||||
|
||||
namespace resource_api
|
||||
{
|
||||
|
||||
class ChatHandler: public ResourceRouter, NotifyClient
|
||||
{
|
||||
public:
|
||||
ChatHandler(StateTokenServer* sts, RsNotify* notify, RsMsgs* msgs);
|
||||
virtual ~ChatHandler();
|
||||
|
||||
// from NotifyClient
|
||||
// note: this may get called from the own and from foreign threads
|
||||
virtual void notifyChatMessage();
|
||||
|
||||
private:
|
||||
void handleWildcard(Request& req, Response& resp);
|
||||
|
||||
StateTokenServer* mStateTokenServer;
|
||||
RsNotify* mNotify;
|
||||
RsMsgs* mRsMsgs;
|
||||
|
||||
RsMutex mMtx;
|
||||
StateToken mStateToken; // mutex protected
|
||||
|
||||
// msgs flow like this:
|
||||
// chatservice -> rawMsgs -> processedMsgs -> deletion
|
||||
|
||||
std::map<ChatId, std::list<ChatMessage> > mRawMsgs;
|
||||
|
||||
class Msg{
|
||||
public:
|
||||
bool incoming;
|
||||
bool was_send;
|
||||
//std::string chat_type;
|
||||
std::string author_id; // peer or gxs id or "system" for system messages
|
||||
std::string author_name;
|
||||
std::string msg; // plain text only!
|
||||
};
|
||||
|
||||
std::map<ChatId, std::list<Msg> > mProcessedMsgs;
|
||||
|
||||
};
|
||||
} // namespace resource_api
|
Loading…
Add table
Add a link
Reference in a new issue