Clear WebAPI when clear chat history in GUI.

Move notifyChatCleared call to p3ChatService
To maintain notify direction.
This commit is contained in:
Phenom 2016-03-31 22:52:53 +02:00
parent ab78825966
commit c6f1cc4e63
14 changed files with 78 additions and 27 deletions

View file

@ -167,6 +167,13 @@ void ChatHandler::notifyChatMessage(const ChatMessage &msg)
mRawMsgs.push_back(msg);
}
void ChatHandler::notifyChatCleared(const ChatId &chat_id)
{
RS_STACK_MUTEX(mMtx); /********** LOCKED **********/
std::list<Msg>& msgs = mMsgs[chat_id];
msgs.clear();
}
void ChatHandler::notifyChatStatus(const ChatId &chat_id, const std::string &status)
{
RS_STACK_MUTEX(mMtx); /********** LOCKED **********/

View file

@ -25,6 +25,7 @@ public:
// from NotifyClient
// note: this may get called from the own and from foreign threads
virtual void notifyChatMessage(const ChatMessage& msg);
virtual void notifyChatCleared(const ChatId& chat_id);
// typing label for peer, broadcast and distant chat
virtual void notifyChatStatus (const ChatId& /* chat_id */, const std::string& /* status_string */);