- added history parameters for chat lobbies

- added max storage time for items in chat history. Avoids filling up the history with chat from volatile peers.
- worked out the layout in config->ChatPage in a more compact design and added help
- set the max size of chat messages to 6000 bytes instead of 2000 which was a bit too low
- default max number of lobby messages saved in each lobby is 20. Avoids flooding for peers who havn't configured it yet.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6770 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-09-27 21:18:44 +00:00
parent f25f46dffb
commit e21d869006
11 changed files with 544 additions and 218 deletions

View file

@ -56,10 +56,13 @@ public:
bool getMessage(uint32_t msgId, HistoryMsg &msg);
void clear(const std::string &chatPeerId);
void removeMessages(const std::list<uint32_t> &msgIds);
bool getEnable(bool ofPublic);
void setEnable(bool forPublic, bool enable);
uint32_t getSaveCount(bool ofPublic);
void setSaveCount(bool forPublic, uint32_t count);
virtual bool getEnable(uint32_t chat_type);
virtual void setEnable(uint32_t chat_type, bool enable);
virtual uint32_t getSaveCount(uint32_t chat_type);
virtual void setSaveCount(uint32_t chat_type, uint32_t count);
virtual void setMaxStorageDuration(uint32_t seconds) ;
virtual uint32_t getMaxStorageDuration() ;
/********* p3config ************/
@ -72,12 +75,22 @@ private:
uint32_t nextMsgId;
std::map<std::string, std::map<uint32_t, RsHistoryMsgItem*> > mMessages;
// Removes messages stored for more than mMaxMsgStorageDurationSeconds seconds.
// This avoids the stored list to grow crazy with time.
//
void cleanOldMessages() ;
bool mPublicEnable;
bool mLobbyEnable;
bool mPrivateEnable;
uint32_t mPublicSaveCount;
uint32_t mLobbySaveCount;
uint32_t mPrivateSaveCount;
uint32_t mMaxStorageDurationSeconds ;
time_t mLastCleanTime ;
std::list<RsItem*> saveCleanupList; /* TEMPORARY LIST WHEN SAVING */
RsMutex mHistoryMtx;