mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
29c090fb44
Now the history is saved encrypted. Please delete all files with "chat*.xml" in your profile folder. Added new config p3HistoryMgr and interface p3History. Added new option to limit the count of the saved history items. Added new simple html optimizer "RsHtml::optimizeHtml" to reduce the size of the html strings. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4623 b45a01b8-16f6-495d-af2f-9b41ad6348cc
84 lines
2.2 KiB
C++
84 lines
2.2 KiB
C++
#ifndef RS_HISTORY_INTERFACE_H
|
|
#define RS_HISTORY_INTERFACE_H
|
|
|
|
/*
|
|
* libretroshare/src/retroshare: rshistory.h
|
|
*
|
|
* RetroShare C++ .
|
|
*
|
|
* Copyright 2011 by Thunder.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License Version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
* USA.
|
|
*
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
*
|
|
*/
|
|
|
|
class RsHistory;
|
|
|
|
extern RsHistory *rsHistory;
|
|
|
|
#include <string>
|
|
#include <inttypes.h>
|
|
#include <list>
|
|
|
|
//! data object for message history
|
|
/*!
|
|
* data object used for message history
|
|
*/
|
|
class HistoryMsg
|
|
{
|
|
public:
|
|
HistoryMsg()
|
|
{
|
|
msgId = 0;
|
|
incoming = false;
|
|
sendTime = 0;
|
|
recvTime = 0;
|
|
}
|
|
|
|
public:
|
|
uint32_t msgId;
|
|
std::string chatPeerId;
|
|
bool incoming;
|
|
std::string peerId;
|
|
std::string peerName;
|
|
uint32_t sendTime;
|
|
uint32_t recvTime;
|
|
std::string message;
|
|
};
|
|
|
|
//! Interface to retroshare for message history
|
|
/*!
|
|
* Provides an interface for retroshare's message history functionality
|
|
*/
|
|
class RsHistory
|
|
{
|
|
public:
|
|
virtual bool getMessages(const std::string &chatPeerId, std::list<HistoryMsg> &msgs, uint32_t loadCount) = 0;
|
|
virtual bool getMessage(uint32_t msgId, HistoryMsg &msg) = 0;
|
|
virtual void removeMessages(const std::list<uint32_t> &msgIds) = 0;
|
|
virtual void clear(const std::string &chatPeerId) = 0;
|
|
|
|
virtual bool getEnable(bool ofPublic) = 0;
|
|
virtual void setEnable(bool forPublic, bool enable) = 0;
|
|
|
|
// 0 = no limit, >0 count of saved messages
|
|
virtual uint32_t getSaveCount(bool ofPublic) = 0;
|
|
virtual void setSaveCount(bool forPublic, uint32_t count) = 0;
|
|
};
|
|
|
|
#endif
|